from typing import Tuple
import math


def euler_to_quaternion(roll: float = 0, pitch: float = 0, yaw: float = 0) -> Tuple[float, float, float, float]:
    """
    Convert Euler to Quaternion

    Args:
        roll (float): roll angle in radian (x-axis)
        pitch (float): pitch angle in radian (y-axis)
        yaw (float): yaw angle in radian (z-axis)

    Returns:
        Tuple[float, float, float, float]: x, y, z, w
    """
    # Abbreviations for the various angular functions
    cy = math.cos(yaw * 0.5)
    sy = math.sin(yaw * 0.5)
    cp = math.cos(pitch * 0.5)
    sp = math.sin(pitch * 0.5)
    cr = math.cos(roll * 0.5)
    sr = math.sin(roll * 0.5)

    # Quaternion
    w = cr * cp * cy + sr * sp * sy
    x = sr * cp * cy - cr * sp * sy
    y = cr * sp * cy + sr * cp * sy
    z = cr * cp * sy - sr * sp * cy

    return x, y, z, w