from typing import Tuple
import math


def _project_accelerations_from_cog(
    rear_axle_longitudinal_velocity: float, angular_velocity: float, cog_acceleration: float, beta: float
) -> Tuple[float, float]:
    """
    Computes the projected accelerations at the rear axle using the Bicycle kinematic model using COG data
    :param rear_axle_longitudinal_velocity: [m/s] Longitudinal component of velocity vector at COG
    :param angular_velocity: [rad/s] Angular velocity at COG
    :param cog_acceleration: [m/s^2] Magnitude of acceleration vector at COG
    :param beta: [rad] ]the angle from rear axle to COG at instantaneous center of rotation
    :return: Tuple with longitudinal and lateral velocities [m/s] at the rear axle
    """
    # Rigid body assumption, can project from COG
    rear_axle_longitudinal_acceleration = math.cos(beta) * cog_acceleration  # [m/s^2]

    # Centripetal accel is a=v^2 / R and angular_velocity = v / R
    rear_axle_lateral_acceleration = rear_axle_longitudinal_velocity * angular_velocity  # [m/s^2]

    return rear_axle_longitudinal_acceleration, rear_axle_lateral_acceleration