Finding rotational axis of sphere from 2 points and measurements

253 Views Asked by At

I feel relatively confident this type of question has been answered, but I'm a bit out of touch - I've taken a university-level introductory linear alegebra course, so I understand a little bit about matricies (which I expect will be used to solve this problem), but I don't know enough to know what I'm looking for. I've been trying to solve this with trigonometry, but I'm falling short somewhere.

Here's the situation: I have two sensors facing a sphere. The sphere might rotate in any arbitrary direction, and I want to be able to determine the (A) azimuth and polar angle of the axis of rotation, and (B) the magnitude.

Both sensors are located 45 degrees beneath the equator of the sphere - from a birds-eye perspective, sensor A is at 210 degrees, and sensor B is at 330 degrees. Both sensors are facing normal to surface of the sphere, and measure movement in X and Y planes, with arbitrary units.

Here's what I've tried so far:

For the sake of orientation, we will say that we are viewing the sphere from above, and the Y axis points directly forward. The X axis points to the right, and the Z axis upward.

For rotation along the X-axis (Y-movement), Vector A + Vector B has only a Y component - x cancels out.

For rotation along the Y-axis (X-movement), Vector A + Vector B has only an X component - y cancels out.

For rotation along the Z-axis (clock-movement), Vector A = Vector B.

To find, therefore, the axis of rotation and speed, we're going to need to do some math.

X-axis rotation = Y component of Vector A + Vector B.  Perhaps the average?
Y-axis rotation = X component of Vector A + Vector B.  Perhaps the average?
Z-Axis rotation = sqrt((common X from A to B)^2 + (common Y from A to B)^2)

Take the x-axis rotation (which is y movement) and treat it as the x-component of a circle.
Take the y-axis rotation (which is x movmeent) and treat it as the y-component of a circle.

Arctan (y/x) = angle of the axis of rotation in the x-y plane = azimuth.
If x is negative, add 180 to account for the range of the arctan function.

Find the amount of that rotation - which will be sqrt(x^2+y^2) for magnitude, and we're going to find the amount of Z axis rotation, too -

arctan (z/(x-y magnitude)) = polar angle, measured from 90 to -90 rather than the standard 0 to 180, but you get the gist.

My problem is that me figures don't appear to be working - take, for example, a sphere that rotates with an axis of rotation that points from the center of the sphere directly in between the sensors - so, -45 degrees polar (135, more normally) and 270 azimuth. The x axis of these sensors will both (unless I'm visualizing wrong) measure 0. The y axis will be directly opposite. Even though this rotation is solely along the Y and Z axis, my "formulas" to find them don't work - Vector A + Vector B = 0, which indicates NO Y-axis rotation, and Vector A and Vector B have no commonality, indicating NO Z-axis rotation.

Where have I gone wrong? I know, at this point, my "formulas" for finding cartesian rotations are wrong, and I'm guessing it's because I haven't accounted for the precise location of the sensors.

Thanks!