struct

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.

Source

Instance methods

==(other : self)
arc_length(angle : Angle)

Returns the length along the circle's circumference of the arc defined by the given angle.

Source
area

Returns the area of the circle.

Source
center

Returns the center of the circle.

Source
circumference

Returns the circumference of the circle.

Source
contains?(other : Point)

Returns whether the given point lies on or inside the circle's circumference.

Source
hash(hasher)

See Object#hash(hasher)

include?(other : Point)

Returns whether the given point lies on the circumference of the circle.

Source
radius

Returns the radius of the circle.

Source
sector_area(angle : Angle)

Returns the area of the sector of the circle defined by the given angle.

Source
to_point(angle : Angle)

Returns the Point along the circle's circumference that corresponds to the given angle.

Source
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.

Source