a guest Jun 16th, 2019 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. For rotation along the X-axis (Y-movement), Vector A + Vector B has only a Y component - x cancels out.
  3. For rotation along the Y-axis (X-movement), Vector A + Vector B has only an X component - y cancels out.
  5. For rotation along the Z-axis (clock-movement), Vector A = Vector B.
  7. To find, therefore, the axis of rotation and speed, we're going to need to do some math.
  9. X-axis rotation = Y component of Vector A + Vector B.  Perhaps the average?
  10. Y-axis rotation = X component of Vector A + Vector B.  Perhaps the average?
  11. Z-Axis rotation = sqrt((common X from A to B)^2 + (common Y from A to B)^2)
  13. Take the x-axis rotation (which is y movement) and treat it as the x-component of a circle.
  14. Take the y-axis rotation (which is x movmeent) and treat it as the y-component of a circle.
  16. Arctan (y/x) = angle of the axis of rotation in the x-y plane = azimuth.
  17. If x is negative, add 180 to account for the range of the arctan function.
  19. 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 -
  21. arctan (z/(x-y magnitude)) = polar angle, measured from 90 to -90 rather than the standard 0 to 180, but you get the gist.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand