Rotating means recalculating your points, based on the angle and rotation point. Do you want to rotate from the center of the canvas, or from the bottom-left ?
pritaeas
Posting Expert
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 874
I'll try to make an example on how to rotate a single point around the center. Just need some time though, I don't have it laying around.
pritaeas
Posting Expert
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 874
I'll give you just the math, perhaps it will get you started. This assumes the point of rotation to be (0, 0). Assume point P(10, 20).
If you want to rotate this point 45 degrees, then you have to do the following:
angle := 45 * pi / 180; // conversion of degrees to radials
Q(x, y) is calculated as follows:
x := 10 * cos(angle) - 20 * sin(angle); // 10 = Px, 20 = Py
y := 20 * cos(angle) + 10 * sin(angle);
pritaeas
Posting Expert
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 874