Points on a rotated rectangle?

We can model the trajectory of a single point by (x',y') = (xc + r cos(theta + theta0), yc + r sin(theta + theta0)) where (x', y') = new position (xc, yc) = center point things rotate around (x, y) = initial point r = distance between (x,y) and (xc, yc) theta = counterclockwise rotation theta0 = initial rotation of (x,y) Our initial point tells us that r sin(theta0) = (y - yc) r cos(theta0) = (x - xc) By the power of trigonomerty: r cos(theta + theta0) = r cos(theta)cos(theta0) - r sin(theta)sin(theta0) = cos(theta)(x - xc) - sin(theta)(y - yc) and r sin(theta + theta0) = r sin(theta)cos(theta0) + r cos(theta)sint(theta0) sin(theta)(x - xc) + cos(theta)(y - yc) So: Given the center point (xc, yc) that stuff is rotating around and Given the point to track (x, y) (your rectangle corner) Calculate dx = x - xc and dy = y - yc Given a rotation theta, the new position of the point will be given by x' = xc + dx cos(theta) - dy sin(theta) y' = yc + dx sin(theta) + dy cos(theta).

We can model the trajectory of a single point by (x',y') = (xc + r cos(theta + theta0), yc + r sin(theta + theta0)) where (x', y') = new position (xc, yc) = center point things rotate around (x, y) = initial point r = distance between (x,y) and (xc, yc) theta = counterclockwise rotation theta0 = initial rotation of (x,y) Our initial point tells us that r sin(theta0) = (y - yc) r cos(theta0) = (x - xc) By the power of trigonomerty: r cos(theta + theta0) = r cos(theta)cos(theta0) - r sin(theta)sin(theta0) = cos(theta)(x - xc) - sin(theta)(y - yc) and r sin(theta + theta0) = r sin(theta)cos(theta0) + r cos(theta)sint(theta0) sin(theta)(x - xc) + cos(theta)(y - yc) So: Given the center point (xc, yc) that stuff is rotating around and Given the point to track (x, y) - (your rectangle corner) Calculate dx = x - xc and dy = y - yc Given a rotation theta, the new position of the point will be given by x' = xc + dx cos(theta) - dy sin(theta) y' = yc + dx sin(theta) + dy cos(theta).

I've edited my code to attempt to do this, but it still isn't working. The point doesn't move at all now. Did I implement it wrong in some way?

I changed the code in my original post to the code I have now. – Snukus Jul 29 at 3:04 You aren't supposed to reset the dx - it depends only on the initial position. – missingno Jul 29 at 3:14 Yep, that was it.

Thanks a lot. – Snukus Jul 29 at 3:23.

Class, but it draws a fancy box around the rectangle. To the BoxTransmuterBase and its derived classes. Boxstyle determines what kind of fancy box will be drawn.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions