I am trying to get the coordinates of a point as it rotates around the center of a rectangle (the point will always be on the perimeter).
So if the rectangle dimensions are 400 x 200 and we declare that due east from center is zero degrees, the starting point (x,y) at zero degrees is (400, 100). Given the center of the rectangle (a,b) is at (200,100), I see from this post that rotating 180 degrees can be solved with the formula (2a-x, 2b-y)
Can you help me with a solution for any degree of rotation?
UPDATE In case you were curious, I am programming in javascript trying to calculate the starting and ending points on a canvas rectangle when working with gradients and knowing the gradient degree.