triangle_area
def
The area of the triangle in the plane with vertices p, q, and r is half the absolute value of (q 0 - p 0) * (r 1 - p 1) - (r 0 - p 0) * (q 1 - p 1).
Statement
noncomputable def triangle_area (p q r : Fin 2 → ℝ) : ℝ
- Defined in
- arXiv:2611.33233, Section 1
- Verified
- 27 Nov 2026
- Axioms
- none listed
- Used by 1
- min_triangle_areaFor a finite point set P in ℝ², the minimum triangle area m(P) is the infimum of the areas of triangles formed by three distinct points of…
Read back from the Lean
The definition triangle_area takes three points p, q, and r in ℝ² (represented as functions Fin 2 → ℝ) and returns the real number (1 / 2) * |(q 0 - p 0) * (r 1 - p 1) - (r 0 - p 0) * (q 1 - p 1)|, which is the standard cross-product / shoelace formula for the area of the triangle with vertices p, q, and r.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
/-- The Euclidean area of the triangle formed by three points in ℝ². -/ noncomputable def triangle_area (p q r : Fin 2 → ℝ) : ℝ := (1 / 2 : ℝ) * |(q 0 - p 0) * (r 1 - p 1) - (r 0 - p 0) * (q 1 - p 1)|