21 template <
typename Po
int,
typename Line =
typename Po
int::Dual>
22 requires ProjectivePlanePrim<Point, Line>
36 : _I_re{std::move(I_re)}, _I_im{std::move(I_im)}, _l_inf{std::move(
l_inf)} {}
42 [[nodiscard]]
constexpr auto l_inf() const -> const Line& {
return this->_l_inf; }
55 [[nodiscard]]
constexpr auto perp(
const Line& v)
const -> Point {
56 const auto alpha = v.dot(this->_I_re);
57 const auto beta = v.dot(this->_I_im);
58 return parametrize(alpha, this->_I_re, beta, this->_I_im);
68 [[nodiscard]]
constexpr auto is_parallel(
const Line& ln_l,
const Line& ln_m)
const ->
bool {
69 return incident(this->_l_inf, ln_l * ln_m);
83 [[nodiscard]]
constexpr auto midpoint(
const Point& pt_a,
const Point& pt_b)
const -> Point {
84 const auto alpha = a.dot(this->_l_inf);
85 const auto beta = pt_b.dot(this->_l_inf);
96 const auto& [a_1, a_2, a_3] = triangle;
112 [[nodiscard]]
constexpr auto omega(
const Point& x)
const -> K {
113 return sq(x.dot(this->_l_inf));
126 [[nodiscard]]
constexpr auto omega(
const Line& x)
const -> K {
127 return sq(x.dot(this->_I_re)) +
sq(x.dot(this->_I_im));
141 template <ProjectivePlane2 _Po
int>
142 [[nodiscard]]
constexpr auto measure(
const _Point& a1,
const _Point& a2)
const {
143 const auto omg = K(this->
omega(a1 * a2));
144 const auto den = K(this->
omega(a1) * this->
omega(a2));
Cayley-Klein plane functions: perpendicularity, altitude, orthocenter, reflection.
Perspective-Euclidean plane class.
Definition persp_plane.hpp:23
constexpr auto midpoint(const Point &pt_a, const Point &pt_b) const -> Point
Compute the midpoint of two points.
Definition persp_plane.hpp:83
constexpr auto perp(const Line &v) const -> Point
Compute the pole of a line.
Definition persp_plane.hpp:55
constexpr persp_euclid_plane(Point I_re, Point I_im, Line l_inf)
Construct a new persp euclid plane object.
Definition persp_plane.hpp:35
constexpr auto tri_midpoint(const Triple< Point > &triangle) const
Compute the midpoints of all three sides of a triangle.
Definition persp_plane.hpp:95
constexpr auto omega(const Line &x) const -> K
Compute the omega value for a line.
Definition persp_plane.hpp:126
constexpr auto is_parallel(const Line &ln_l, const Line &ln_m) const -> bool
Check if two lines are parallel.
Definition persp_plane.hpp:68
constexpr auto measure(const _Point &a1, const _Point &a2) const
Compute the cross-ratio measure between two elements.
Definition persp_plane.hpp:142
constexpr auto l_inf() const -> const Line &
Definition persp_plane.hpp:42
constexpr auto omega(const Point &x) const -> K
Compute the omega value for a point.
Definition persp_plane.hpp:112
Integral concept.
Definition common_concepts.h:84
Definition ck_concepts.hpp:11
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
typename T::value_type Value_type
Value type of a type.
Definition common_concepts.h:23
std::array< Point, 3 > Triple
Type alias for an array of three points (a triangle)
Definition proj_plane.hpp:58
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 sq(const T &a)
Square function.
Definition pg_common.hpp:164
Fraction.
Definition fractions.hpp:92