class Geometric::Polygon
- Geometric::Polygon
- Array(Geometric::Vec2)
- Reference
- Object
Defined in:
geometric/object/polygon.crConstructors
Instance Method Summary
- #after(i : Int32) : Vec2
- #area : Real
- #centroid : Vec2
- #contains?(v : Vec2)
-
#convex_hull : Polygon
Returns convex hull of points that consist of
(value, index)
. - #inspect(io)
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 Inew(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 Uaccumulate : 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
Instance Method Detail
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