question: public float toPitch ( ) { double x = getX ( ) ; double z = getZ ( ) ; if ( x == 0 && z == 0 ) { return getY ( ) > 0 ? - 90 : 90 ; } else { double x2 = x * x ; double z2 = z * z ; double xz = Math . sqrt ( x2 + z2 ) ; return ( float ) Math . toDegrees ( Math . atan ( - getY ( ) / xz ) ) ; } }
target:  Get this vector's pitch as used within the game.