Tag Info

New answers tagged

0

X = x*cos(θ) - y*sin(θ) Y = x*sin(θ) + y*cos(θ) This will give you the location of a point rotated θ degrees around the origin. Since the corners of the square are rotated around the center of the square and not the origin, a couple of steps need to be added to be able to use this formula. First you need to set the point relative to the origin. Then you ...


0

It is a common technique to rotate a point about a pivot by translating to a coordinate system where the pivot is the origin, then rotating about this origin, then translating back to world coordinates. (A very good explanation of this approach is available at Khan Academy) However you are not storing your rectangle corners in world coordinates so we can ...


0

See the Wikipedia article on rotation. The essence is this: (1) If c is the center point, then the corners are c + (L/2,W/2), +/- etc., where L and W are the length & width of the rectangle. (2) Translate the rectangle so that center c is at the origin, by subtracting c from all four corners. (3) Rotate the rectangle by 40 deg via the trig formulas ...



Top 50 recent answers are included