I would find the angles from each point to each other point, take
modulus(pi/2), concatenate the list with its negative, and sort.
Rotation by each angle produces a new alignment. Only J primitives are
needed.
Use complex numbers to represent the (x,y) values, and *. to convert to
angles.
Henry Rich
On 11/15/2023 5:52 PM, 'PMA' via Wiki wrote:
Dear J-Wiki,
I want to make a script that, given the X/Y values of a 2D dot-graph,
will rotate the graph around its designated origin, looking for
instances of 2 or more points coming into new horizontal &/or vertical
alignment, and at each such instance output the full set of current
X/Y values (integer-rounded).
Could you point me to the main needed ingredients?
Thanks in advance,
Peter Armstrong
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm