Geode::Circle
Inherits Struct < Value < Object
The Circle struct represents a circle.
Constructors
new(radius : Number::Primitive = 1, center : Point = Point.new)
Creates a new Circle. Note that the radius must be positive.
Instance methods
==(other : self)
arc_length(angle : Angle)
Returns the length along the circle's circumference of the arc defined by the given angle.
contains?(other : Point)
Returns whether the given point lies on or inside the circle's circumference.
hash(hasher)
See Object#hash(hasher)
include?(other : Point)
Returns whether the given point lies on the circumference of the circle.
sector_area(angle : Angle)
Returns the area of the sector of the circle defined by the given angle.
to_point(angle : Angle)
Returns the Point along the circle's circumference that corresponds to the given angle.
to_s(io : IO)
Returns a string representation of the circle in the form (x-h)^2 + (y-k)^2 = r, where (h, k) is the circle's circumference and r is the circle's radius squared.