Projektív sík
 
Betöltés...
Keresés...
Nincs egyezés
ppoint.hpp
Ugrás a fájl dokumentációjához.
1
5
6#ifndef PPOINT_HPP
7#define PPOINT_HPP
8
9#include "PObject.hpp"
10
11namespace bme {
12
13 template<typename T>
14 class PLine;
15 template<typename T>
22 class PPoint : public PObject<T> {
23 public:
24 PPoint(T a = T(0), T b = T(0), T c = T(1)) : PObject<T>(a, b, c) {}
25 PPoint(const PObject<T>& other) : PObject<T>(other.getX(), other.getY(), other.getZ()) {}
26
27 bool operator==(const PPoint<T>& other) const {
28 return this->equals(other);
29 }
30
31 bool operator!=(const PPoint<T>& other) const {
32 return !this->equals(other);
33 }
34
35 bool operator<(const PPoint<T>& other) const {
36 return this->less(other);
37 }
38
40
45 PLine<T> operator+(const PPoint& other) const {
46 return PLine<T>(this->op(other));
47 }
48
50
55 bool is_on(const PLine<T>& line) const {
56 return this->incident(line);
57 }
58 };
59
61 template<typename T>
62 ostream& operator<<(ostream& os, const PPoint<T>& P) {
63 os << "(" << P.getX() << "," << P.getY() << "," << P.getZ() << ")";
64 return os;
65 }
66
68 template<typename T>
69 bool collinear(const PPoint<T>& A, const PPoint<T>& B, const PPoint<T>& C) { return dependent(A, B, C); }
70
71
72}
73
74#endif
PObject< T > op(const PObject< T > &other) const
A leszármazottak + ill. * operátorának közös megvalósítása.
Definition pobject.hpp:66
bool incident(const PObject< T > &other) const
A leszármazottak illeszkedést vizsgáló tagfüggvényének közös megvalósítása.
Definition pobject.hpp:61
T getY() const
Az objektum y koordinátájának lekérdezése.
Definition pobject.hpp:92
T getZ() const
Az objektum z koordinátájának lekérdezése.
Definition pobject.hpp:94
bool equals(const PObject< T > &other) const
A leszármazottak == operátorának közös megvalósítása.
Definition pobject.hpp:46
T getX() const
Az objektum x koordinátájának lekérdezése.
Definition pobject.hpp:90
bool less(const PObject< T > &other) const
A leszármazottak < operátorának közös megvalósítása.
Definition pobject.hpp:51
PPoint(const PObject< T > &other)
Definition ppoint.hpp:25
PPoint(T a=T(0), T b=T(0), T c=T(1))
Definition ppoint.hpp:24
PLine< T > operator+(const PPoint &other) const
Pontokra illeszkedő egyenes meghatározása.
Definition ppoint.hpp:45
bool is_on(const PLine< T > &line) const
Illeszkedés vizsgálata.
Definition ppoint.hpp:55
bool operator==(const PPoint< T > &other) const
Definition ppoint.hpp:27
bool operator!=(const PPoint< T > &other) const
Definition ppoint.hpp:31
bool operator<(const PPoint< T > &other) const
Definition ppoint.hpp:35
Definition pline.hpp:11
bool collinear(const PPoint< T > &A, const PPoint< T > &B, const PPoint< T > &C)
Megvizsgálja, hogy három pont kollineáris-e.
Definition ppoint.hpp:69
bool dependent(const PObject< T > &A, const PObject< T > &B, const PObject< T > &C)
Projektív objektumok összefüggőségének vizsgálata.
Definition pobject.hpp:111
ostream & operator<<(ostream &os, const PLine< T > &P)
Projektív egyenes koordinátáinak kiírása a képernyőre.
Definition pline.hpp:60
Projektív sík objektumai.