you were correct to remove the *0.017xx as your were already stating ANGLE as radians.
however, and I haven’t checked… but are you sure you don’t have this inverted?
dim angle as double=(((atan2(y1 - y, x1 - x)) * 180 )/ 3.14159265)
or do you even need the 180 and Pi? since Atan2 is also radians
Not sure exactly what you’re trying to calculate. If it’s gravitational force, then I don’t know how the log() function manages to get in there. The gravitational force between two objects is simply:
F=gm1m2/r^2
where
g is the gravitational constant 6.674e-11 (SI units)
m1 and m2 are the masses of the objects,
r is the distance separating them,
The direction of the force is the direction of the line joining the two points. So the angle ? is given as:
? = atan2(p1y-p2y,p1x-p2x)
where p1x,p1y,p2x and p2y are the x and y coordinates of points p1 and p2.
Once you know force, then acceleration is given by:
a=F/m
where F is force, m is the mass of the object, and a is acceleration.
To convert the acceleration into separate x and y components you use the standard trigonometric conversions.
ay=a sin(?)
ax=a cos(?)