<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def yaw_pitch(self):
 """ Calculate the yaw and pitch of this vector """

        if not self:
            return YawPitch(0, 0)
        ground_distance = math.sqrt(self.x ** 2 + self.z ** 2)
        if ground_distance:
            alpha1 = -math.asin(self.x / ground_distance) / math.pi * 180
            alpha2 = math.acos(self.z / ground_distance) / math.pi * 180
            if alpha2 > 90:
                yaw = 180 - alpha1
            else:
                yaw = alpha1
            pitch = math.atan2(-self.y, ground_distance) / math.pi * 180
        else:
            yaw = 0
            y = round(self.y)
            if y > 0:
                pitch = -90
            elif y < 0:
                pitch = 90
            else:
                pitch = 0
        return YawPitch(yaw, pitch)