porder(<point>,<points>)
numeric
The order of elements in a point array. The elements are sorted by their distance as supplied "target" point, least first. This function returns the same number of values as the point array length.
The values in the array parameter are left unchanged by this function. The action of the function is merely to compute the sort order.
<point>
The target point.
<points>
The point array to
be ordered.
Declare an array of 16 points.
point pts[] = <(69,697),(353,819),(600,691),(522,338),\ (253,425),(763,472),(794,125),(394,103),\ (244,259),(522,434),(716,747),(578,822),\ (300,741),(131,350),(113,197),(538,119)>
Order the points by distance from the point (400,400).
numeric nn[] = porder((400,400),pts) tell nn
The above will display 16 numeric values.
10 4 5 9 14 8 16 15 3 13 6 2 1 12 11 7
Functions: |