Defines a circle in two-dimensional coordinates.

Hierarchy

  • Circle2d

Implements

Constructors

Properties

_center: Point2d
radius: number

Gets or sets the radius.

Accessors

  • get diameter(): number
  • Gets the diameter of the circle.

    Returns number

Methods

  • Checks if the given point is located inside the circle.

    Parameters

    • point: Point2d

      The reference point.

    Returns boolean

    true if the point is inside the circle.

  • Checks if the current circle intersect with the given shape.

    Parameters

    Returns boolean

    true it the two shapes intersect, otherwise false.

  • Checks if the given point is on one edge of the circle.

    Parameters

    • point: Point2d

      The reference point.

    • threshold: number = 0

      A value used as a threshold / range to check if the point is on one edge.

    Returns boolean

    true if the point is on edge.

  • Rotates the circle by the given angle in degree, around a point.

    Parameters

    • angle: number

      The rotation angle.

    • origin: Point2d = ...

      The origin from which the rotation is supposed to be done.

    Returns void

  • Gets the area of a circle.

    Parameters

    • radius: number

      The circle radius.

    Returns number

  • Gets the perimeter of a circle.

    Parameters

    • radius: number

      The circle radius.

    Returns number

Generated using TypeDoc