Distance Between Two Processes


Quiest

I like turtles!
Joined
Sep 2, 2004
Messages
3,411
Age
40
Location
Dteuschland ;)
I have to ask this, I know I could just sub the x and y values of the two processes, but I know there is a get_distance command or something in Fenix, so if anybody could explain to me how it works/how to use it, I would be very thankful :)


Forget about it, just found out how simple it is.
Erm, shame on me for opening this stupid thread. Sorry.
 
Just use fget_dist(x1,y1,x2,y2). It tells the distanxe between (x1,y1) and (x2,y2).


Example:
Have two processes, either use their ids or add a

process1_x=x; process1_y=y;

in the loop of the first process and

process2_x=x; process2_y=y;

in the loop of the second process and then have a variable, for example "distance":

distance=fget_dist(process1_x,process1_y,process2_x,process2_y);

in a loop and you have the distance between those two processes all the time :D
Sure, this could be easier with ids but I don`t really like them, cause most of the time they produce errors when running the code (like "process not active" or something even if the needed process is there...)
 
Back
Top