Rotate around origin

BlitzMax Forums/BlitzMax Beginners Area/Rotate around origin

Lukasha(Posted 2008) [#1]
Hi.

How can I calculate the position of an object which rotates around the origin or an other point on the screen.
for example if I want to draw an oval at the position 300,400 at the beginning an then it should rotate around the origin.
How can I calculate the position depending on the angle of the rotation?
Sry, I'm not that good in Trigonometry^^
Thank you.
Lukasha..


Sledge(Posted 2008) [#2]
Plot xPos + ( Sin(angle)*radius ),yPos - ( Cos(angle)*radius  )


EDIT: I'm assuming you mean a circle and not an oval; xPos and yPos are the x and y of the origin, obv.


tonyg(Posted 2008) [#3]
This should help.


Lukasha(Posted 2008) [#4]
Thx, you helped me..


Yan(Posted 2008) [#5]
You could use Max2D's handle system...

...Not a particularly clear example but it was to hand. You should pay particular attention to 'TVectObj.Draw()' and bear in mind that the current 'system scale' will also play a part.