33 template <
typename Po
int,
typename Line>
34 requires ProjectivePlane<Point, Line>
35 constexpr auto incident(
const Point& pt_p,
const Line& ln_l) ->
bool {
47 template <
typename Line,
typename... Args>
48 requires(ProjectivePlanePrim<Line, Args> && ...)
49 constexpr auto
coincident(const Line& ln_l, const Args&... pt_r) ->
bool {
50 return (
incident(pt_r, ln_l) && ...);
58 template <
typename Po
int>
using Triple = std::array<Point, 3>;
74 const auto& [a_1, a_2, a_3] = triangle;
76 return std::array{a_2 * a_3, a_1 * a_3, a_1 * a_2};
88 template <ProjectivePlanePrim2 Po
int,
typename Fn>
92 const auto& [a_1, a_2, a_3] = triangle;
93 return std::array{func(a_2, a_3), func(a_1, a_3), func(a_1, a_2)};
104 template <ProjectivePlanePrim2 Po
int>
106 const auto& [A, B, C] = tri1;
107 const auto& [D, E, F] = tri2;
108 const auto O = (A * D) * (B * E);
142 template <ProjectivePlane2 Po
int>
143 constexpr auto harm_conj(
const Point& A,
const Point& B,
const Point& C) -> Point {
145 const auto lC = C * (A * B).aux();
166 template <ProjectivePlaneGeneric2 _Po
int>
167 constexpr auto harm_conj(
const _Point& A,
const _Point& B,
const _Point& C) -> _Point {
169 const auto AB = A * B;
170 const auto P = AB.aux();
171 const auto R = P.aux2(C);
172 const auto S = (A *
R) * (B * P);
173 const auto Q = (B *
R) * (A * P);
188 template <ProjectivePlane2 Po
int>
189 constexpr auto is_harmonic(
const Point& A,
const Point& B,
const Point& C,
const Point& D)
200 template <
typename Po
int,
typename Line>
201 requires ProjectivePlane<Point, Line>
218 : _m{std::move(ln_m)}, _o{std::move(o)}, _c{_m.
dot(_o)} {}
230 constexpr auto operator()(
const Point& pt_p)
const -> Point {
231 return parametrize(this->_c, pt_p, K(-2 * pt_p.dot(this->_m)), this->_o);
245 return parametrize(this->_c, ln_l, K(-2 * ln_l.dot(this->_o)), this->_m);
256 template <
typename Po
int,
typename Line>
257 requires ProjectivePlaneGeneric<Point, Line>
272 : _m{std::move(ln_m)}, _o{std::move(o)} {}
281 constexpr auto operator()(
const Point& pt_p)
const -> Point {
282 auto po = pt_p * this->_o;
283 auto B = po * this->_m;
296 template <ProjectivePlanePrim2 Po
int>
300 const auto& [A, B, C] = coline1;
301 const auto& [D, E, F] = coline2;
303 const auto G = (A * E) * (B * D);
304 const auto H = (A * F) * (C * D);
305 const auto I = (B * F) * (C * E);
318 template <ProjectivePlanePrim2 Po
int>
322 const auto bool1 =
persp(tri1, tri2);
323 const auto bool2 =
persp(trid1, trid2);
324 assert((bool1 && bool2) || (!bool1 && !bool2));
Definition proj_plane.hpp:202
constexpr auto operator()(const Point &pt_p) const -> Point
Apply the involution to a point.
Definition proj_plane.hpp:230
constexpr Involution(Line ln_m, Point o)
Construct a new Involution object.
Definition proj_plane.hpp:217
constexpr auto operator()(const Line &ln_l) const -> Line
Apply the involution to a line.
Definition proj_plane.hpp:244
Generic involution class for projective planes.
Definition proj_plane.hpp:258
constexpr auto operator()(const Point &pt_p) const -> Point
Apply the involution to a point.
Definition proj_plane.hpp:281
constexpr involution_generic(Line ln_m, Point o)
Construct a new generic involution object.
Definition proj_plane.hpp:270
Definition ck_concepts.hpp:11
constexpr auto check_pappus(const std::array< Point, 3 > &coline1, const std::array< Point, 3 > &coline2) -> bool
Check Pappus Theorem.
Definition pg_plane.hpp:68
constexpr auto incident(const Point &pt_p, const Line &ln_l) -> bool
The code snippet is defining a function named incident that checks if a point pt_p is incident to a l...
Definition proj_plane.hpp:35
constexpr auto persp(const std::array< Point, 3 > &tri1, const std::array< Point, 3 > &tri2) -> bool
return whether two triangles are perspective
Definition pg_plane.hpp:112
typename T::value_type Value_type
Value type of a type.
Definition common_concepts.h:23
constexpr auto R(const Point &A, const Point &B, const Point &C, const Point &D)
Compute the cross ratio of four collinear points.
Definition proj_plane_measure.hpp:78
std::array< Point, 3 > Triple
Type alias for an array of three points (a triangle)
Definition proj_plane.hpp:58
constexpr auto tri_dual(const std::array< Point, 3 > &triangle) -> std::array< Line, 3 >
Dual of triangle.
Definition pg_plane.hpp:93
constexpr auto harm_conj(const Point &pt_a, const Point &pt_b, const Point &pt_c) -> Point
Harmonic conjugate.
Definition pg_plane.hpp:184
constexpr auto is_harmonic(const Point &A, const Point &B, const Point &C, const Point &D) -> bool
Check if four points form a harmonic range.
Definition proj_plane.hpp:189
constexpr auto coincident(const Point &pt_p, const Point &pt_q, const Point &pt_r) -> bool
Coincident.
Definition pg_plane.hpp:51
constexpr auto parametrize(const Value &lambda_val, const Point &pt_p, const Value &mu_val, const Point &pt_q) -> Point
Homogeneous parametrization of point or line (free function)
Definition pg_common.hpp:185
constexpr auto check_desargue(const std::array< Point, 3 > &tri1, const std::array< Point, 3 > &tri2) -> bool
Check Desargue's Theorem.
Definition pg_plane.hpp:133
constexpr auto tri_func(Fn &&func, const Triple< Point > &triangle)
Apply a binary function to all pairs of triangle vertices.
Definition proj_plane.hpp:89
constexpr auto dot(const std::array< int64_t, 3 > &pt_a, const std::array< int64_t, 3 > &pt_b) -> int64_t
Dot product of two homogeneous 3-vectors.
Definition pg_object.hpp:23
C++20 concepts for projective planes with coordinate access and parametrization.