Skip to main content

AngleUnit

An enum representing a range of angle units, including:

  • DEGREES
  • RADIANS
  • GRADIANS
  • REVOLUTIONS
  • ARCSECONDS
  • ARCMINUTES
  • MILIRADIANS

Utility Methods

angleUnit.toDeg

Converts the given angle to degrees using the given angle unit.

Params
  • x: Number - The angle to convert to degrees
  • AngleUnit.RADIANS.toDeg(PI/2) // 90

    AngleUnit.ARCSECONDS.toDeg(90) // 0.025

    angleUnit.toRad

    Converts the given angle to radians using the given angle unit.

    Params
  • x: Number - The angle to convert to radians
  • AngleUnit.DEGREES.toRad(90) // 1.5707963267948966

    AngleUnit.ARCSECONDS.toRad(90) // 0.0004363323129985824

    angleUnit.to

    Converts the given angle to the given angle unit.

    Params
  • to: AngleUnit - The angle unit to convert to
  • x: Number - The angle to convert
  • AngleUnit.DEGREES.to(AngleUnit.RADIANS, 90) // 1.5707963267948966

    AngleUnit.ARCSECONDS.to(AngleUnit.DEGREES, 90) // 0.025