I tested your code and it is doing exactly what it supposed to do. if you don't move the center, the point rotates around the radius created by the center and the point. if you move the center while processing, the radius either becomes larger or smaller and will creates a different radius of rotation. if you want it to continually rotate around a fixed radius than you need to make it a fixed radius. this is how I tested it:
SuperStrict
Function GetRotationCords:TDrawingPoint(Angle:Float, Source:TDrawingPoint, Center:TDrawingPoint)
Local Radius:Double = Sqr((source.X - center.x) ^ 2 + (source.Y - center.Y) ^ 2)
Local NewX:Double = Center.X + radius * Cos(angle)
Local NewY:Double = Center.Y + radius * Sin(angle)
Return CreateDrawingPoint(newx, newy)
End Function
'----------
Type TDrawingPoint
Field X:Float
Field Y:Float
Function Create:TDrawingPoint(X:Float, Y:Float)
Local DP:TDrawingPoint = New TDrawingPoint
dp.X = x
dp.Y = y
Return dp
End Function
End Type
Function CreateDrawingPoint:TDrawingPoint(X:Float, Y:Float)
Return TDrawingPoint.Create(x, y)
End Function
Local a# = 0.0
Local source:tdrawingpoint = createDrawingPoint(160,160)
Local center:tdrawingPoint = CreateDrawingPoint(200,200)
Graphics 800,600
Repeat
'Cls
source = GetRotationCords(a,source,center)
Plot center.x,center.y
DrawOval source.x-10,source.y-10,20,20
a:+1.0
Flip()
Until KeyDown(key_escape)
if you want it to rotate around a moving object then you need to have a fixed radius and keep track of the angle.
[edited]
if you want to determine the original angle the point is
from the center then you need the atan2 math function.