> 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

Reply via email to