Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. Vector3d.prototype.pitchAndYawTo = function(position) {
  2. var dx = this.x - position.x;
  3. var dy = this.y - position.y;
  4. var dz = this.z - position.z;
  5. return {
  6. pitch: toDegrees(Math.atan2(dz, Math.sqrt(dx * dx + dy * dy))),
  7. yaw: toDegrees(Math.atan2(dy, dx)) + 180
  8. }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement