Maker.js, a Microsoft Garage project, is a JavaScript library for creating and sharing modular line drawings for CNC and laser cutters.

View project on GitHub Star

Api - angle Module

Index

Variables

Private linkLineMap

linkLineMap: object

Type declaration

  • [pathType: string]: function

Functions

Private copyFractionalPart

  • copyFractionalPart(src: number, dest: number): number
  • Parameters

    • src: number
    • dest: number

    Returns number

Private getFractionalPart

  • getFractionalPart(n: number): string

Private getLinkLine

mirror

  • mirror(angleInDegrees: number, mirrorX: boolean, mirrorY: boolean): number
  • Mirror an angle on either or both x and y axes.

    Parameters

    • angleInDegrees: number

      The angle to mirror.

    • mirrorX: boolean

      Boolean to mirror on the x axis.

    • mirrorY: boolean

      Boolean to mirror on the y axis.

    Returns number

    Mirrored angle.

noRevolutions

  • noRevolutions(angleInDegrees: number): number
  • Ensures an angle is not greater than 360

    Parameters

    • angleInDegrees: number

      Angle in degrees.

    Returns number

    Same polar angle but not greater than 360 degrees.

ofArcEnd

  • Get an arc's end angle, ensured to be greater than its start angle.

    Parameters

    Returns number

    End angle of arc.

ofArcMiddle

  • ofArcMiddle(arc: IPathArc, ratio?: number): number
  • Get the angle in the middle of an arc's start and end angles.

    Parameters

    • arc: IPathArc

      An arc path object.

    • Default value ratio: number = 0.5

      Optional number between 0 and 1 specifying percentage between start and end angles. Default is .5

    Returns number

    Middle angle of arc.

ofArcSpan

  • Total angle of an arc between its start and end angles.

    Parameters

    Returns number

    Angle of arc.

ofChainLinkJoint

  • Get the angle of a joint between 2 chain links.

    Parameters

    Returns number

    Angle between chain links.

ofLineInDegrees

  • Angle of a line path.

    Parameters

    • line: IPathLine

      The line path to find the angle of.

    Returns number

    Angle of the line path, in degrees.

ofPointInDegrees

  • ofPointInDegrees(origin: IPoint, pointToFindAngle: IPoint): number
  • Angle of a line through a point, in degrees.

    Parameters

    • origin: IPoint

      Point of origin of the angle.

    • pointToFindAngle: IPoint

      The point to find the angle.

    Returns number

    Angle of the line throught the point, in degrees.

ofPointInRadians

  • ofPointInRadians(origin: IPoint, pointToFindAngle: IPoint): number
  • Angle of a line through a point, in radians.

    Parameters

    • origin: IPoint

      Point of origin of the angle.

    • pointToFindAngle: IPoint

      The point to find the angle.

    Returns number

    Angle of the line throught the point, in radians.

Private setFractionalPart

  • setFractionalPart(n: number, fractionalPart: string): number
  • Parameters

    • n: number
    • fractionalPart: string

    Returns number

toDegrees

  • toDegrees(angleInRadians: number): number
  • Convert an angle from radians to degrees.

    Parameters

    • angleInRadians: number

      Angle in radians.

    Returns number

    Angle in degrees.

toRadians

  • toRadians(angleInDegrees: number): number
  • Convert an angle from degrees to radians.

    Parameters

    • angleInDegrees: number

      Angle in degrees.

    Returns number

    Angle in radians.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc