@taylorhmorris/geometry
    Preparing search index...

    Class RectBeta

    A class for Rectangles.

    Index

    Constructors

    • Beta

      The constructor of the Rect class

      Parameters

      • x: number

        the x position of the Rect

      • y: number

        the y position of the Rect

      • width: number

        the width of the Rect

      • height: number

        the height of the Rect

      • angle: number = 0

        the angle of rotation of the Rect in radians (default: 0)

      Returns Rect

    Properties

    _height: number
    _width: number
    angle: number

    The angle of rotation of the Rect in radians

    x: number

    The x coordinate of the Rect

    y: number

    The y coordinate of the Rect

    Accessors

    • get bottom(): number
      Beta

      The y position of the bottom side of the Rect

      Returns number

    • set bottom(value: number): void
      Beta

      Parameters

      • value: number

      Returns void

    • get left(): number
      Beta

      The x position of the left side of the Rect

      Returns number

    • set left(value: number): void
      Beta

      Parameters

      • value: number

      Returns void

    • get perimeter(): number
      Beta

      Calculates the perimeter of the Rect

      Returns number

      the perimeter of the Rect

    • get right(): number
      Beta

      The x position of the right side of the Rect

      Returns number

    • set right(value: number): void
      Beta

      Parameters

      • value: number

      Returns void

    • get top(): number
      Beta

      The y position of the top side of the Rect

      Returns number

    • set top(value: number): void
      Beta

      Parameters

      • value: number

      Returns void

    Methods

    • Beta

      Checks if two Rects overlap

      Parameters

      Returns number

      the magnitude of the overlap

    • Alpha

      Rotates the Rect by theta around a given origin

      Parameters

      • theta: number

        the amount in radians to rotate

      • origin: PointArray | Point = ...

        the origin Point to rotate around (default: Rect.center))

      Returns void