ProjGeom 1.0.11
Loading...
Searching...
No Matches
pg_line.hpp
Go to the documentation of this file.
1// The template and inpoints for the -*- C++ -*- 3d line classes.
2// Initially implemented by Wai-Shing Luk <luk036@gmail.com>
3//
4
9#pragma once
10
11#include "pg_common.hpp"
12#include "pg_object.hpp"
13
14namespace fun {
15
16 // Forward declarations.
17
18 template <Ring _K> struct pg_point;
19
25 template <Ring _K> struct pg_line : pg_object<_K, pg_line<_K>, pg_point<_K>> {
28 using _Base2 = std::array<_K, 3>;
29
35 constexpr explicit pg_line(const _Base2& a) : _Base{a} {}
36
44 constexpr pg_line(const _K& x, const _K& y, const _K& z) : _Base{_Base2{x, y, z}} {}
45 };
46
53 template <Ring _K> constexpr auto meet(const pg_line<_K>& ln_l, const pg_line<_K>& ln_m)
54 -> pg_point<_K> {
55 return ln_l * ln_m;
56 }
57
58} // namespace fun
Definition ck_concepts.hpp:11
constexpr auto meet(const pg_line< _K > &ln_l, const pg_line< _K > &ln_m) -> pg_point< _K >
Definition pg_line.hpp:53
Core projective geometry object template (pg_object, PgObject, PgPoint, PgLine).
Projective line: two dimensional subspace of K^3.
Definition pg_line.hpp:25
std::array< _K, 3 > _Base2
Definition pg_line.hpp:28
constexpr pg_line(const _K &x, const _K &y, const _K &z)
Construct a new pg_object object.
Definition pg_line.hpp:44
constexpr pg_line(const _Base2 &a)
Construct a new pg object object.
Definition pg_line.hpp:35
Generic projective geometry object (value-type templated)
Definition pg_object.hpp:79
Definition pg_point.hpp:19