• Convert degrees, gradians, radians, and turns to degrees. If no unit is given in the string, degrees is used.

    Example

    toDegrees('180') // return 180
    toDegrees('180deg') // return 180
    toDegrees('0.75turn') // return 270
    toDegrees('-0.25turn') // return 270

    Parameters

    • angle: string

      A string comprised of an angle and a unit of deg|grad|rad|turn; if no unit is given, deg is used.

    Returns number

Generated using TypeDoc