import math


def calculate_angle_ratio(diameter):
    """Calculates the angle ratio for a given diameter, used
    for translating turn angle of a gear to distance on a gear rack.
    distance = degrees * angle ratio
    angle = distance / angle ratio
    Same for speeds.

    :param diameter: Median diameter of the gear
    :type diameter: float
    :return: Angle Ratio used for calculations
    :rtype: float
    """
    return diameter * math.pi * (1/360)