Class: Math::Geometry::Rectangle

Inherits:
Quadrilateral show all
Defined in:
lib/ruuuby/math/geometry/shape/quadrilateral.rb

Overview

Direct Known Subclasses

Square

Instance Attribute Summary

Attributes inherited from PlaneFigure

#num_sides

Instance Method Summary collapse

Methods inherited from Quadrilateral

#area

Methods inherited from PlaneFigure

#sum_of_interior_angles

Constructor Details

#initialize(length, height) ⇒ Rectangle

Returns a new instance of Rectangle.

Parameters:



28
29
30
31
32
# File 'lib/ruuuby/math/geometry/shape/quadrilateral.rb', line 28

def initialize(length, height)
  @length = length
  @height = height
  super()
end

Instance Method Details

#interior_anglesArray<ThetaAngle>

Returns:



35
36
37
38
39
40
41
# File 'lib/ruuuby/math/geometry/shape/quadrilateral.rb', line 35

def interior_angles
  if @angles.nil?
    corner_angle = θ°(90)
    @angles      = [corner_angle, corner_angle, corner_angle, corner_angle]
  end
  @angles
end