Interface IClosedShape2d

Defines common methods and properties exposed by a closed shape.

Hierarchy

Implemented by

Properties

area: number

Gets the are of the shape.

perimeter: number

Gets the perimeter of the shape.

Methods

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

    Parameters

    • point: Point2d

      The reference point.

    Returns boolean

    true if the point is inside the shape.

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

    Parameters

    Returns boolean

    true it the two shapes intersect, otherwise false.

  • Checks if the given point is in the edge of the shape.

    Parameters

    • point: Point2d

      The reference point.

    • threshold: number

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

    Returns boolean

  • Rotates the shape 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

  • Translates the shape using the given vector for direction.

    Parameters

    • vector: Vector2d

      The vector defining the direction.

    Returns void

Generated using TypeDoc