2D Pivoting around a point

Blitz3D Forums/Blitz3D Programming/2D Pivoting around a point

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

To go back to your original example, x=5 z=3, we have

Radius#=Sqr(5^2+3^2)

Then points on a circle are given by

newX# = CenterX# + Radius*Cos(Angle#)
newY# = CenterZ# + Radius*Sin(Angle#)

The only remaining question is where to start. The answer is

Angle0# = ATan2( 3, 5 )

With this angle we get newX = 5 and newY = 3.

After that use 45+Angle0, 90+Angle0 etc.