Two objects in 2 dimensional space are facing the
same direction, say D degrees. How does one determine which
object is on the left if the positions of the two objects A
and B in 2D, are given as A and B, for example as follows?
'A B' =: 2 1;1 _1
D =: 90 NB. facing to the East
result: A is on the left
'A B' =: _1 0;1 1
D =: 0 NB. facing to the North
result: A is on the left
'A B' =: _1 0;_1 0
D =: 0 NB. facing to the North
result: A is on the left and on the right (undecided?)
How does one compute such results?
(B=)
Brian Schott
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm