import math


def rotation_matrix_to_euler_angle(R):
    """
    Converts a rotation matrix to [yaw, pitch, roll]
    """
    yaw = math.atan2(R[1, 0], R[0, 0])
    pitch = math.atan2(-R[2, 0], math.sqrt(R[2, 1] ** 2 + R[2, 2] ** 2))
    roll = math.atan2(R[2, 1], R[2, 2])

    return yaw, pitch, roll