Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. For rotation along the X-axis (Y-movement), Vector A + Vector B has only a Y component - x cancels out.
  2.  
  3. For rotation along the Y-axis (X-movement), Vector A + Vector B has only an X component - y cancels out.
  4.  
  5. For rotation along the Z-axis (clock-movement), Vector A = Vector B.
  6.  
  7. To find, therefore, the axis of rotation and speed, we're going to need to do some math.
  8.  
  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)
  12.  
  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.
  15.  
  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.
  18.  
  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 -
  20.  
  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.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement