11#if __cpp_concepts >= 201907L
23 template <
class Line,
class Po
int =
typename Line::Dual>
24#if __cpp_concepts >= 201907L
25 requires CayleyKleinPlanePrimitiveDual<Line, Point>
28 return l_1.perp().incident(l_2);
43 template <
class Po
int,
class Line>
44#if __cpp_concepts >= 201907L
45 requires CayleyKleinPlanePrimitiveDual<Point, Line>
47 constexpr auto altitude(
const Point& pt_p,
const Line& ln_m) -> Line {
48 return ln_m.perp().meet(pt_p);
61 template <
class Po
int,
class Line =
typename Po
int::Dual>
62#if __cpp_concepts >= 201907L
63 requires CayleyKleinPlanePrimitiveDual<Point, Line>
65 constexpr auto orthocenter(
const std::array<Point, 3>& triangle) -> Point {
66 const auto& [a_1, a_2, a_3] = triangle;
68 const auto t1 =
altitude(a_1, a_2.meet(a_3));
69 const auto t2 =
altitude(a_2, a_3.meet(a_1));
83 template <
class Po
int,
class Line>
84#if __cpp_concepts >= 201907L
85 requires CayleyKleinPlanePrimitiveDual<Point, Line>
87 constexpr auto tri_altitude(
const std::array<Point, 3>& triangle) -> std::array<Line, 3> {
88 const auto [l1, l2, l3] =
tri_dual(triangle);
89 const auto& [a_1, a_2, a_3] = triangle;
109 template <
typename Value,
class Po
int,
class Line =
typename Po
int::Dual>
110#if __cpp_concepts >= 201907L
111 requires CayleyKleinPlaneDual<Value, Point, Line>
113 constexpr auto reflect(
const Line& mirror,
const Point& pt_p) -> Point {
114 return involution(mirror.perp(), mirror, pt_p);
C++20 concepts for Cayley-Klein planes.
Definition ck_concepts.hpp:11
constexpr auto orthocenter(const std::array< Point, 3 > &triangle) -> Point
Compute the orthocenter of a triangle (Cayley-Klein).
Definition ck_plane.hpp:65
constexpr auto tri_altitude(const std::array< Point, 3 > &triangle) -> std::array< Line, 3 >
Compute all three altitudes of a triangle (Cayley-Klein).
Definition ck_plane.hpp:87
constexpr auto reflect(const Line &mirror, const Point &pt_p) -> Point
Reflect a point across a line (Cayley-Klein).
Definition ck_plane.hpp:113
constexpr auto tri_dual(const std::array< Point, 3 > &triangle) -> std::array< Line, 3 >
Dual of triangle.
Definition pg_plane.hpp:93
constexpr auto altitude(const Point &pt_p, const Line &ln_m) -> Line
Compute the altitude from a point to a line (Cayley-Klein).
Definition ck_plane.hpp:47
constexpr auto coincident(const Point &pt_p, const Point &pt_q, const Point &pt_r) -> bool
Coincident.
Definition pg_plane.hpp:51
constexpr auto is_perpendicular(const Line &l_1, const Line &l_2) -> bool
Check if two lines are perpendicular (Cayley-Klein).
Definition ck_plane.hpp:27
constexpr auto involution(const Point &origin, const Line &mirror, const Point &pt_p) -> Point
Involution on a point.
Definition pg_plane.hpp:210
Projective plane axioms and geometric checks (coincidence, Pappus, Desargues).