← Workbench

Polygon — vertices, area and containment

A square, triangle or star with its area, closed path and probe.

Build the polygon and probe Polygon.new!/1 builds the shape; the probe is the point to test for containment.

vertices 4
area 1.0
arc length 4.0
contains probe true

Source unavailable.

frame 1

Girihelix.Engine.Geometry.Polygon.new!([Girihelix.Engine.Geometry.Point.new(0.0, 0.0), Girihelix.Engine.Geometry.Point.new(1.0, 0.0), Girihelix.Engine.Geometry.Point.new(1.0, 1.0), Girihelix.Engine.Geometry.Point.new(0.0, 1.0)])