Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function compass {
- parameter vectorInput.
- local EastVector is vcrs(up:vector,north:vector).
- local component_north is vDot(north:vector:normalized, vectorInput).
- local component_east is vDot(EastVector: normalized, vectorInput).
- return mod((arcTan2(component_east, component_north)+360),360).
- }
- function compass2 {
- parameter vectorInput.
- local EastVector is vcrs(up:vector,north:vector).
- local component_north is vDot(north:vector, vectorInput).
- local component_east is vDot(EastVector, vectorInput).
- return mod((arcTan2(component_east, component_north)+360),360).
- }
- function test {
- parameter v.
- print compass(v) - compass2(v).
- }
- test(v(1,2,3)).
- test(v(4,5,6)).
- test(up:vector).
- test(v(0, 0, 0)).
Advertisement
Add Comment
Please, Sign In to add comment