ixfx
    Preparing search index...

    Function degreeArc

    • Computes the angle arc between a start and end angle, given in degrees. It properly accounts for the wrap-around values.

      Clockwise movement is negative.

      Orientation of angles on a circle is as follows:

            90
      |
      180 ---+--- 0
      |
      270

      Example, from 'east' (0deg) to 'south' (270deg)

      degreeArc(0, 270);          // 'short' is default, result: -90
      degreeArc(0, 270, `long`); // 270
      degreeArc(0, 270, `short`); // -90
      degreeArc(0, 270, `cw`); // clockwise: -90
      degreeArc(0, 270, `ccw`); // counter-clockwise: 270

      Or from 'east' (0deg) to 'north' (90deg):

      degreeArc(0, 90);          // 'short' is default, result: 90
      degreeArc(0, 90, `long`); // -270
      degreeArc(0, 90, `short`); // 90
      degreeArc(0, 90, `cw`); // clockwise: -270
      degreeArc(0, 90, `ccw`); // counter-clockwise: 90

      Use radianArc to operate in radians (which this function calls behind the scenes).

      Parameters

      • start: number

        Start angle, in degrees

      • end: number

        End angle, in degrees

      • direction: AngleDirection = ...

        Calculate in the specified direction (default: short)

      Returns number

      Angle of arc, in degrees.