A filled nondegenerate triangle is exactly an intersection of three explicit halfspaces. In particular, endpoint and forbidden-point support conditions are proved for the actual convex-hull datatype, rather than a surrogate polygon.
The coordinate determinant of two planar vectors.
Equations
- ConwaySoifer.cross u v = u.1 * v.2 - u.2 * v.1
Instances For
@[simp]
The oriented doubled coordinate area of three vertices.
Equations
- ConwaySoifer.triangleDet a b c = ConwaySoifer.cross (b - a) (c - a)
Instances For
The barycentric coefficient of the second vertex relative to the first.
Equations
- ConwaySoifer.baryFirst a b c p = ConwaySoifer.cross (p - a) (c - a) / ConwaySoifer.triangleDet a b c
Instances For
The barycentric coefficient of the third vertex relative to the first.
Equations
- ConwaySoifer.barySecond a b c p = ConwaySoifer.cross (b - a) (p - a) / ConwaySoifer.triangleDet a b c
Instances For
The three outward normals, with orientation corrected by the determinant.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The three closed halfspaces determined by an oriented triangle.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
ConwaySoifer.triangleHalfspaces_iff
(a b c p : Point)
:
p ∈ (triangleHalfspaces a b c).carrier ↔ 0 ≤ baryFirst a b c p ∧ 0 ≤ barySecond a b c p ∧ baryFirst a b c p + barySecond a b c p ≤ 1
@[simp]
@[simp]
No equilateral assumption is needed for the geometric representation.
noncomputable def
ConwaySoifer.EquilateralTriangle.halfspaces
(T : EquilateralTriangle)
:
HalfspaceSystem (Fin 3)
The halfspace system induced by the triangle's three vertices.
Equations
- T.halfspaces = ConwaySoifer.triangleHalfspaces (T.vertices 0) (T.vertices 1) (T.vertices 2)
Instances For
theorem
ConwaySoifer.EquilateralTriangle.carrier_eq_halfspaces
(T : EquilateralTriangle)
(hs : 0 < T.side)
:
theorem
ConwaySoifer.EquilateralTriangle.full_endpoint_support
(T : EquilateralTriangle)
(hs : 0 < T.side)
{v d : Point}
(hv : v ∈ T.carrier)
(hd : sqDist d (0, 0) = 1)
:
∃ (i : Fin 3),
0 < (T.halfspaces.normal i) d ∧ (T.halfspaces.normal i) (linePoint v d (rayLen T v d)) = T.halfspaces.offset i ∧ ∀ q ∈ T.carrier, (T.halfspaces.normal i) q ≤ (T.halfspaces.normal i) (linePoint v d (rayLen T v d))
theorem
ConwaySoifer.EquilateralTriangle.forbidden_support
(T : EquilateralTriangle)
(hs : 0 < T.side)
{v d : Point}
(hv : v ∈ T.carrier)
{t : ℝ}
(ht : 0 < t)
(hout : linePoint v d t ∉ T.carrier)
:
∃ (i : Fin 3),
0 < (T.halfspaces.normal i) d ∧ ∀ q ∈ T.carrier, (T.halfspaces.normal i) q < (T.halfspaces.normal i) (linePoint v d t)