This project has moved. For the latest updates, please go here.

Determine if point is inside rotated text's boundary

Apr 23, 2008 at 6:37 AM
Hi all,

how can i be sure if a point is inside of a rotated text's boundary?

I'm using minX minY maxX maxY now but that is ofcourse bad, because that is the rectangle and not the text-covered-area.
I'd like to be sure the point is within the 'rotated' boundary/extents.

The code to determine if a point is inside a polygon is what i intend to use here. Got that art done already but the rotated boundary puzzles me.

Does anyone have any info on this matter?
Apr 23, 2008 at 7:21 AM

I have an idea to rotate the point around the same point of rotation as the text, but oposite direction. It should be only easy transformation. Than check if the rotated point is inside non-rotated text boundary. If so also non-rotated point is inside the rotated text boundary.

Correct me if I am wrong
Apr 23, 2008 at 9:23 AM
Hi shadun,

Thanks for the reply. Interesting logic! Not thought of a sollution that way around :o)

My intentions are to store the rotated text-boundary polygon coordinates in a database.

Is there a non-point-transforming solution ?