Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Rotating rectangle by its center [duplicate]

Writer Matthew Harrington
$\begingroup$

We have a rectangle that is rotating by its center from $0$ to $360$ degrees. This rectangle rotation starts in $0$ degrees when we know all four rectangle points. We also know the angle we want to rotate the rectangle.

What I need is a formula for these points when rectangle is rotated.

Picture

$\endgroup$ 2

1 Answer

$\begingroup$

When you rotate the point $(x,y)$ through an angle of $\theta$ (radians, not degrees) about the origin the new position is $$ (x \cos\theta - y \sin\theta\ , \quad x\sin\theta + y\cos\theta). $$

()

If the center of the rectangle is not at the origin, translate the center to move it there, rotate, then translate back.

$\endgroup$ 0