28 template <Ring K>
constexpr auto ratio_ratio(
const K& a,
const K& b,
const K& c,
const K& d) {
32 return (a * d) / (b * c);
53 template <
typename Po
int,
typename Line>
54 requires ProjectivePlane<Point, Line>
55 constexpr auto x_ratio(
const Point& A,
const Point& B,
const Line& line_l,
const Line& line_m) {
56 return ratio_ratio(A.dot(line_l), A.dot(line_m), B.dot(line_l), B.dot(line_m));
77 template <ProjectivePlaneCoord2 Po
int>
78 constexpr auto R(
const Point& A,
const Point& B,
const Point& C,
const Point& D)
82 if (
cross0(A, B) != K(0)) {
83 return R0(A, B, C, D);
86 return R1(A, B, C, D);
96 template <ProjectivePlane2 Po
int>
97 constexpr auto R(
const Point& A,
const Point& B,
const Point& C,
const Point& D) {
98 const auto O = (C * D).aux();
99 return x_ratio(A, B, O * C, O * D);
116 template <ProjectivePlaneCoord2 Po
int>
117 constexpr auto R0(
const Point& A,
const Point& B,
const Point& C,
const Point& D) {
135 template <ProjectivePlaneCoord2 Po
int>
136 constexpr auto R1(
const Point& A,
const Point& B,
const Point& C,
const Point& D) {
Integral concept.
Definition common_concepts.h:84
Definition ck_concepts.hpp:11
constexpr auto R1(const Point &A, const Point &B, const Point &C, const Point &D)
Compute cross ratio using xz-plane projection.
Definition proj_plane_measure.hpp:136
auto cross0(const std::array< _K, 3 > &v_a, const std::array< _K, 3 > &v_b) -> _K
1st term of Cross product (yz-plane projection)
Definition pg_common.hpp:25
constexpr auto R0(const Point &A, const Point &B, const Point &C, const Point &D)
Compute cross ratio using yz-plane projection.
Definition proj_plane_measure.hpp:117
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
constexpr auto x_ratio(const Point &A, const Point &B, const Line &line_l, const Line &line_m)
Cross Ratio.
Definition proj_plane_measure.hpp:55
constexpr auto ratio_ratio(const K &a, const K &b, const K &c, const K &d)
Compute the ratio of two ratios.
Definition proj_plane_measure.hpp:28
auto cross1(const std::array< _K, 3 > &v_a, const std::array< _K, 3 > &v_b) -> _K
2nd term of Cross product (xz-plane projection)
Definition pg_common.hpp:41
Fraction.
Definition fractions.hpp:92