Function Newbie question...
malte.brill at t-online.de
Fri Dec 6 05:24:00 EST 2002
I wrote a small function that returns the distance between two Points.
Function getDistance x1,y1,x2,y2
put sqrt((X1 - X2) ^ 2 + (Y1 - Y2) ^ 2) into theDistance
It works for me if I pass the values to it on a mouseUp event.
put item 1 of the loc of graphic "kreis1" into x1
put item 1 of the loc of graphic "kreis2" into x2
put item 2 of the loc of graphic "kreis1" into y1
put item 2 of the loc of graphic "kreis2" into y2
put getDistance (x1,y1,x2,y2)
O.K., but if I have more than two objects (lets say about 5). how could I
check the distances between all of them efficiantly?
1->5 2->5 ... 5->4
Using a repeat structure seams not being a good idea to me. So here I am
stuck, as the number of objects I want to check might vary from time to
More information about the Use-livecode