I have a starting point in 3D space (x,y,z) which corresponds to the center of a circle and an end point (x2,y2,z2) which corresponds to the surface of the sphere. I also have many other end points on the surface of the sphere (x3,y3,z3 for example) with each having the same radius length (rr).
I want to calculate the angle of movement from the center point (start) to the end point and for all my other end points. Eventually, given say 100 spheres, I want to see if the end points all move with similar directionality/angles from the center. Given this purpose, I would need a direction of say 0 and 360 to "look similar" so I think I need to use some type of specific plane.
The comment at the end of this post (https://math.stackexchange.com/questions/707673/find-angle-in-degrees-from-one-point-to-another-in-2d-space) has a nice graphic and answer using atan2 function but that is only for 2D space.
This post (Signed angle between two 3D vectors with same origin within the same plane) and this one Angle between 3 points in 3d space got me started.
This (The X angle between two 3D vectors?) is also helpful but calculates the wrong type of angle (I think) based on the horizontal system.
Given all that here's what I've come up with so far. Here are some points:
a = c(-0.0684486861, 0.0125857380, 0.0201056441) #start/center of sphere
b = c(-0.0650557851, 0.0175286346, -0.0228805516) #end point
v1 = c( (a[1] - b[1]), (a[2] - b[2]), (a[3] - b[3]) ) #vector
Then I think I need to calculate the dot product between v1 and perhaps a vector parallel to the plane at 90 degrees from the 2 points? To then take cosine between the angles? But if the radius always the same isn't that easier?
I do not know enough of the math to figure this out for even a set of two points much less develop code for doing this for all my spheres/points. Guidance greatly appreciated.