Guest User

Untitled

a guest
Aug 13th, 2021
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1.  
  2. function compass {
  3. parameter vectorInput.
  4. local EastVector is vcrs(up:vector,north:vector).
  5. local component_north is vDot(north:vector:normalized, vectorInput).
  6. local component_east is vDot(EastVector: normalized, vectorInput).
  7. return mod((arcTan2(component_east, component_north)+360),360).
  8. }
  9.  
  10. function compass2 {
  11. parameter vectorInput.
  12. local EastVector is vcrs(up:vector,north:vector).
  13. local component_north is vDot(north:vector, vectorInput).
  14. local component_east is vDot(EastVector, vectorInput).
  15. return mod((arcTan2(component_east, component_north)+360),360).
  16. }
  17.  
  18. function test {
  19. parameter v.
  20.  
  21. print compass(v) - compass2(v).
  22. }
  23.  
  24. test(v(1,2,3)).
  25. test(v(4,5,6)).
  26. test(up:vector).
  27. test(v(0, 0, 0)).
Advertisement
Add Comment
Please, Sign In to add comment