Class: Sevgi::Geometry::Square

Inherits:
Rect
  • Object
show all
Defined in:
lib/sevgi/geometry/elements/rect.rb

Overview

Rectangle with equal width and height.

Class Method Summary collapse

Methods inherited from Rect

call, #draw!, from_corners, from_size, #height, #width

Class Method Details

.[](length, position: Origin) ⇒ Sevgi::Geometry::Square

Builds a square from side length and top-left position.

Parameters:

  • length (Numeric)

    side length

  • position (Sevgi::Geometry::Point, Array<Numeric>) (defaults to: Origin)

    top-left position

Returns:

Raises:



94
# File 'lib/sevgi/geometry/elements/rect.rb', line 94

def self.[](length, position: Origin) = from_size(length, length, position:)