struct Geode::Circle
- Geode::Circle
- Struct
- Value
- Object
Overview
The Circle
struct represents a circle.
Defined in:
geode/circle.crConstructors
Instance Method Summary
- #==(other : self)
-
#arc_length(angle : Angle)
Returns the length along the circle's circumference of the arc defined by the given angle.
-
#area
Returns the area of the circle.
-
#center : Geode::Point
Returns the center of the circle.
-
#circumference
Returns the circumference of the circle.
-
#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.
-
#radius : Float32 | Float64 | Int128 | Int16 | Int32 | Int64 | Int8 | UInt128 | UInt16 | UInt32 | UInt64 | UInt8
Returns the radius 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 andr
is the circle's radius squared.
Constructor Detail
Creates a new Circle
. Note that the radius must be positive.
Instance Method Detail
Returns the length along the circle's circumference of the arc defined by the given angle.
Returns whether the given point lies on or inside the circle's circumference.
Returns whether the given point lies on the circumference of the circle.
Returns the radius of the circle.
Returns the area of the sector of the circle defined by the given angle.
Returns the Point
along the circle's circumference that corresponds to the given angle.
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.