The proof I posted is simple geometery that any high schooler should know.
Can you post the test code you wrote. The error is porbably a sign error on
my part.
To understnd what I did addume the center of the figure is in the center of
a coordinate axis (x,y). I used zero degreees to be on the positive x-axis
and positive rotation in the counter-clockwise direction. The original upper
left corner of the figure would then be (-1 * width/2, height/2).
the screen coordinates are in pixels since left, top, width, and height are
al in pixels. The (0,0) screen locztion is in the upper left corner of the
screen. Positive x direction is left to right. Positive y direction is from
top to bottom which is opposite from standard conventions. I used standard
conventions so I didn't get confused.
The differences in convention is only important to keep the direction
straight. There is a trick I learned in geometry where we refered to the
quandrants of the coordinate axis by "CAST". This stood for Cosine, All,
Sine, Tan. The quandrants are as follows
1st - x positive, y positive
2nd - x negative, y positive
3rd - x negative, y negative
4th - x positive, y negative
CAST was the order for 4, 1, 2, and 3 quadrants indicating which trig
functions were positive.
C: 4th quandrant cosine is positive
A: 1st quadrant all trig functions are positive
S: 2nd quadrant sine is positive
T: 3rd quadrant Tan is positive
Therefore in the other quadrants the functions were negative. The trig
functions in VBA will follow these conventions as long as you use standad
conventions where 0 degrees is on the positive x axis and the positive
rotation is in the counter-clockwise directions. You then hae to remember to
multiply by -1 to compensate for the Y Pixels being in the oppositive
direction from the Y coordinate axis.