A slightly different approach. Rather than search out all alignments
and then deduce their degrees of rotation, I mean now to specify as
input the degrees for which rotations are to be generated.
Example: given a graph of one dot -- 22j10 -- I'd input that value with
a rotation choice -- 15 degrees counterclockwise -- and expect a single
integer-rounded output value of approximately 19j15.
(Those two "15"s are coincidental.)
My question is, what J syntax will generate that output?
Thanks again for your consideration!
Peter A
On 11/16/23 09:26, Henry Rich wrote:
This is my reply to a question someone posed yesterday. This
afternoon I will post a complete solution. It's like the puzzle
problems I posed you, but just a little longer and comes from a real
user need. If you want to solve it yourself you will need the primitives
j. dyad, / monad, / dyad, ~, -. dyad, ^ monad, | dyad, -, /: dyad, *.
monad
hhr
On 11/15/2023 6:49 PM, Henry Rich wrote:
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
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm