Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector3d.prototype.pitchAndYawTo = function(position) {
- var dx = this.x - position.x;
- var dy = this.y - position.y;
- var dz = this.z - position.z;
- return {
- pitch: toDegrees(Math.atan2(dz, Math.sqrt(dx * dx + dy * dy))),
- yaw: toDegrees(Math.atan2(dy, dx)) + 180
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement