Glad you figured it out! However, I had a whole thing planned, and I’d like to follow through.

Let’s take a closer look. As a reminder, here are the points at 45° and 315°.

x goes from -100 to 0. If 0° is halfway between that, then x is -50. y goes from 0 to -100, so the same logic applies.

Now, let’s draw it:

That square is off-center!

Did we do the math wrong? Well, no. That diagonal line is a perfectly straight line between the points (-100, 0) and (0, -100). Our square is halfway along that line.

The halfway point isn’t what we want. It just isn’t. We want our square to trace out a circle as it rotates, not a straight line. (I actually drew this circle for you in the examples above. It’s faint, but it’s there.)

Here’s what the square *should* look like at 0°:

See how it’s aligned with the circle? Also notice that neither x nor y equals -50.

To get a better sense of how it follows the circle, check out this interactive version.