Class: Circle

Inherits:
Ellipse show all
Defined in:
lib/sitac_objects.rb

Overview

Represents a circle, given its center and radius

Instance Attribute Summary collapse

Attributes inherited from Ellipse

#hradius, #vradius

Instance Method Summary collapse

Methods inherited from Ellipse

#accept

Methods included from SITACObjects

#as_point

Constructor Details

#initialize(name, center, radius) ⇒ Circle

Returns a new instance of Circle.

Parameters:

  • name (String)

    the name of the circle

  • center (Point, Array)

    the center of the circle

  • radius (Float)

    the radius of the circle



150
151
152
# File 'lib/sitac_objects.rb', line 150

def initialize(name, center, radius)
  super(name, center, radius, radius)
end

Instance Attribute Details

#centerObject (readonly)

Returns the value of attribute center.



145
146
147
# File 'lib/sitac_objects.rb', line 145

def center
  @center
end

#nameObject (readonly)

Returns the value of attribute name.



145
146
147
# File 'lib/sitac_objects.rb', line 145

def name
  @name
end

#radiusObject (readonly)

Returns the value of attribute radius.



145
146
147
# File 'lib/sitac_objects.rb', line 145

def radius
  @radius
end