Polygons #
This file defines polygons in affine spaces.
For the special case n = 3, an interconversion is provided with Affine.Triangle.
Main definitions #
Polygon P n: A polygon withnvertices in a typeP.
A coercion to function so that vertices can
be written as poly i instead of poly.vertices i
Equations
The i-th edge as an affine map R →ᵃ[R] P.
Equations
- Polygon.edgePath R poly i = AffineMap.lineMap (poly.vertices i) (poly.vertices ((finRotate n) i))
Instances For
The i-th edge as a set of points using an affineSegment.
Equations
- Polygon.edgeSet R poly i = affineSegment R (poly.vertices i) (poly.vertices ((finRotate n) i))
Instances For
The boundary of the polygon is the union of all its edges.
Equations
- Polygon.boundary R poly = ⋃ (i : Fin n), Polygon.edgeSet R poly i
Instances For
Polygons with nondegenerate vertices also have nondegenerate edges.
Interconversion with Affine.Triangle #
Embedding from affine triangles to polygons with 3 vertices.
Equations
- Affine.Triangle.toPolygon = { toFun := fun (t : Affine.Triangle R P) => { vertices := t.points }, inj' := ⋯ }
Instances For
Convert a polygon with 3 nondegenerate vertices to an Affine.Triangle.
Equations
- Polygon.toTriangle R p h = { points := p.vertices, independent := ⋯ }
Instances For
Converting a 3-polygon to a triangle and back yields the original polygon.
The polygon obtained from a triangle has nondegenerate vertices.
Converting a triangle to a polygon and back yields the original triangle.