Class Rect

Represents an immutable rectangle in 2D space.

PS2 instructions: DO NOT change this class. If you need more operations, define functions in utils.ts.

Hierarchy

  • Rect

Constructors

Properties

Methods

Constructors

  • Make a rectangle with opposing corners (x1, y1) and (x2, y2). Requires x1 <= x2 and y1 <= y2.

    Parameters

    • x1: number

      x-coordinate of one corner

    • y1: number

      y-coordinate of one corner

    • x2: number

      x-coordinate of other corner

    • y2: number

      y-coordinate of other corner

    Returns Rect

Properties

x1: number

x-coordinate of one corner

x2: number

x-coordinate of other corner

y1: number

y-coordinate of one corner

y2: number

y-coordinate of other corner

Methods

  • Returns string

Generated using TypeDoc