The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

# Thread: Corner Coordinates of Rotated Rectangle

1. 3
posts
Registered User

## Corner Coordinates of Rotated Rectangle

I bet there's an easy answer to this one:

How do I get the x and y position of a rotated rectangle's (or an MC that contains a rectangular shape) top-right, bottom-right and bottom-left corners (not its bounding rectangle)?

Thnx!

E

2. I haven't used it, but you might look into localToGlobal. That might get you what you need pretty easily.

That or trigonometry.

3. you can use the matrix you rotated the object with (or create one).

you will need the original coordinates for each of the four points:
click

4. I think you will indeed have to get busy with your maths mate!

Will you know the radius of your rounded corners? If so, it may not be so difficult to find the x / y of given points along the curve, if thats what you meant.

5. I haven't used localToGlobal, but it seems like it would work. Is there a reason the two of you didn't agree with my suggestion?

6. Originally Posted by cesig
I haven't used localToGlobal, but it seems like it would work. Is there a reason the two of you didn't agree with my suggestion?
Only because i'm an idiot and didn't read the post properly! lol! You know how it is, sneaking around forums whilst the boss isnt looking your way! Just skim read it. I thought he was on about a rounded rectangle (finding the points along the curved corner)

Your right, localToGlobal will nail it! sorry Cesig