class Geode::RegularPolygon

Overview

The RegularPolygon class represents a polygon with sides of constant length separated by angles of constant measure.

Defined in:

geode/polygon.cr

Constructors

Instance Method Summary

Instance methods inherited from class Geode::Polygon

area area, include?(other : Point) include?, perimeter perimeter, segments segments, vertices : Array(Geode::Point) vertices

Constructor methods inherited from class Geode::Polygon

new(vertices : Array(Point))
new(*vertices : Point)
new

Constructor Detail

def self.new(sides : Int, circumcircle : Circle = Circle.new, rotation : Angle = Angle.new(0)) #

Creates a new RegularPolygon.


[View source]

Instance Method Detail

def circumcircle : Geode::Circle #

Returns the circumcircle of the polygon, i.e. the circle that wholly surrounds the polygon and all its vertices.


[View source]