ProjGeom 1.0.11
Loading...
Searching...
No Matches
pg_point.hpp
Go to the documentation of this file.
1// The template and inlines for the -*- C++ -*- pg pt_p 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 template <Ring _K> struct pg_line;
18
19 template <Ring _K> struct pg_point : pg_object<_K, pg_point<_K>, pg_line<_K>> {
22 using _Base2 = std::array<_K, 3>;
23 // using value_type = _K;
24
29 explicit pg_point(const pg_point<_K>&) = default;
30
35 pg_point(pg_point<_K>&&) noexcept = default;
36
43 auto operator=(const pg_point<_K>&) -> pg_point<_K>& = delete;
44
50 auto operator=(pg_point<_K>&&) noexcept -> pg_point<_K>& = default;
51
57 constexpr explicit pg_point(const _Base2& a) : _Base{a} {}
58
66 constexpr pg_point(const _K& x, const _K& y, const _K& z) : _Base{_Base2{x, y, z}} {}
67 };
68
81 template <Ring _K> constexpr auto join(const pg_point<_K>& pt_p, const pg_point<_K>& pt_q)
82 -> pg_line<_K> {
83 return pt_p * pt_q;
84 }
85
86} // namespace fun
Definition ck_concepts.hpp:11
constexpr auto join(const pg_point< _K > &pt_p, const pg_point< _K > &pt_q) -> pg_line< _K >
Return the join (product) of two points to form a line.
Definition pg_point.hpp:81
Core projective geometry object template (pg_object, PgObject, PgPoint, PgLine).
Projective line: two dimensional subspace of K^3.
Definition pg_line.hpp:25
Generic projective geometry object (value-type templated)
Definition pg_object.hpp:79
Definition pg_point.hpp:19
pg_point(pg_point< _K > &&) noexcept=default
Construct a new pg pt_p object.
constexpr pg_point(const _K &x, const _K &y, const _K &z)
Construct a new pg_object object.
Definition pg_point.hpp:66
pg_point(const pg_point< _K > &)=default
Construct a new pg pt_p object.
std::array< _K, 3 > _Base2
Definition pg_point.hpp:22