class Geometric::Polygon

Defined in:

geometric/object/polygon.cr

Constructors

Instance Method Summary

Instance methods inherited from class Array(Geometric::Vec2)

[]=(point : Point, value) []=, chmax(i : Int, value : T)
chmax(indexes : Tuple, value)
chmax
, chmin(i : Int, value : T)
chmin(indexes : Tuple, value)
chmin
, compress(values : Array(T), *, index : Int = 0)
compress(*, index : Int = 0) : Array(Int32)
compress
, convex_hull : Array(Int32) convex_hull, convex_hull_with_index : Array(Tuple(T, Int32)) convex_hull_with_index, each_unique_permutation(reuse : Bool = false)
each_unique_permutation(reuse : Bool = false, &) : Nil
each_unique_permutation
, gcd_mobius gcd_mobius, gcd_mobius! gcd_mobius!, gcd_zeta gcd_zeta, gcd_zeta! gcd_zeta!, next_permutation! : Bool next_permutation!, next_permutation? : Array(T)? next_permutation?, unique_permutations : Array(Array(T)) unique_permutations

Constructor methods inherited from class Array(Geometric::Vec2)

new(sizes : Tuple(*I), initial_value) forall I
new(sizes : Tuple(*I), &) forall I
new

Instance methods inherited from module Comparable(Array(T))

max(x : T) max, min(x : T) min

Instance methods inherited from module Indexable(Geometric::Vec2)

[](point : Point) [], []?(point : Point) []?, each_pair(&)
each_pair
each_pair
, fetch(point : Point, &) fetch

Instance methods inherited from module Enumerable(Geometric::Vec2)

accumulate(init : U) : Array(U) forall U
accumulate : Array(T)
accumulate(init : U, &block : U, T -> U) : Array(U) forall U
accumulate(&block : T, T -> T) : Array(T)
accumulate
, mex : T mex, mex_sorted : T mex_sorted, tally(*, default : Int32) : Hash(T, Int32) tally, unique : self
unique(&) : self
unique

Constructor Detail

def self.new(points : Array(Vec2)) #

[View source]
def self.new(initial_capacity : Int) #

[View source]
def self.new #

[View source]
def self.new(size : Int, &) #

[View source]

Instance Method Detail

def after(i : Int32) : Vec2 #

[View source]
def area : Real #

[View source]
def centroid : Vec2 #

[View source]
def contains?(v : Vec2) #

[View source]
def convex_hull : Polygon #
Description copied from class Array(Geometric::Vec2)

Returns convex hull of points that consist of (value, index).

[4, 2, 3, 4, 1, 2, 1, 3, 2, 4].convex_hull # => [4, 2, 1, 1, 2, 4]
  | 0 1 2 3 4 5 6 7 8 9
--+---------------------
4 | o     x           o
3 |     x         x
2 |   o       x     o
1 |         o   o

[View source]
def inspect(io) #

[View source]