@Stefano - Affine transformation --that's it! And the programming technique I was thinking of is called an Augmented Matrix: http://en.wikipedia.org/wiki/Augmented_matrix
I'll compare it for speed and simplicity with coordinate geometry with complex numbers -- I fear though the latter will outperform it on both counts, even with the need for its separate displacement step (which geometers call a "translation"). The trouble with being a non-specialist is that jargon doesn't stick in the head. If it did, then lookup on Wikipedia or (if all else fails) Google would be easy. On Thu, May 30, 2013 at 9:32 AM, Stefano Lanzavecchia <[email protected]> wrote: > > Reinventing The (Square) Wheel Department. > > > > Problem: given a rectangle ABCD defined by four points on the xy-plane, > > detect whether a given point (a mouseclick) falls inside ABCD. > > This might help. > > > Note that side > > AB isn't necessarily parallel to the x or y axes. > > But first you must rotate the rectangle to make its axes parallel to the x > and y axis. > > > Displacement in the xy-plane can't normally be represented by a linear > > transformation, but long ago I read of a way of introducing a third > virtual z- > > axis, which did allow both rotation and displacement to be handled in one > > shot by a 3-by-3 matrix. Does anybody know of this technique? > > I believe you are talking about "affine transformations": > http://en.wikipedia.org/wiki/Affine_transformation > > Have fun :-) > -- > Stefano > > [ "Defeat is not the worst of failures. Not to have tried is the true > failure." --- George Edward Woodberry ] > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
