Im trying to use polar coordinates to make an object orbit around a central point, but the object keeps drifing in towards the centre...as far as i can see the code is fine and the object should remain static until i have altered T variable.
Can anyone see whats wrong? (all values are double)
For Local PingObject:TPing=EachIn PingObject_List
X=PingObject.getX()
Y=PingObject.getY()
X1=X-384
Y1=Y-384
R=Sqr((X1*X1)+(Y1*Y1))
T=ATan2(Y1,X1)
X1=R*Cos(T)
Y1=R*Sin(T)
X=X1+384
Y=Y1+384
PingObject.setXY(X, Y)
Next
Can anyone see whats wrong? (all values are double)
For Local PingObject:TPing=EachIn PingObject_List
X=PingObject.getX()
Y=PingObject.getY()
X1=X-384
Y1=Y-384
R=Sqr((X1*X1)+(Y1*Y1))
T=ATan2(Y1,X1)
X1=R*Cos(T)
Y1=R*Sin(T)
X=X1+384
Y=Y1+384
PingObject.setXY(X, Y)
Next