Skip to content

Latest commit

 

History

History
112 lines (56 loc) · 1.42 KB

Rect.md

File metadata and controls

112 lines (56 loc) · 1.42 KB

Math::Rect

This is the Math::Rect class.

Represents a rectangle.

Initializer

$rect = Rect($x: Num, $y: Num, $width: Num, $height: Num)

Creates a rectangle, given its origin (bottom-left vertex) and dimensions.

  • x: Num - X-coordinate of the rectangle's origin.

  • y: Num - Y-coordinate of the rectangle's origin.

  • width: Num - Width of the rectangle.

  • height: Num - Height of the rectangle.

Methods

vertices

$rect.vertices

Computed property. A list of the four vertices of the rectangle.

bottomLeft

$rect.bottomLeft

Computed property. Bottom left vertex of the rectangle.

bottomRight

$rect.bottomRight

Computed property. Bottom right vertex of the rectangle.

topLeft

$rect.topLeft

Computed property. Top left vertex of the rectangle.

topRight

$rect.topRight

Computed property. Top right vertex of the rectangle.

bottom

$rect.bottom

Computed property. Line segment formed by the bottom vertices of the rectangle.

top

$rect.top

Computed property. Line segment formed by the top vertices of the rectangle.

center

$rect.center

Computed property. Center point of the rectangle.

End of the Math::Rect class.

This file was generated automatically by the Ferret compiler from Rect.frt.