Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Constructors

Properties

Methods

Constructors

  • new Rect(x1: number, y1: number, x2: number, y2: number): Rect
  • 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
x2: number
y1: number
y2: number

Methods

  • toString(): string
  • Returns string

Generated using TypeDoc