Projektív sík
 
Betöltés...
Keresés...
Nincs egyezés
pline.hpp
Ugrás a fájl dokumentációjához.
1
5
6#ifndef PLINE_HPP
7#define PLINE_HPP
8
9#include "pobject.hpp"
10
11namespace bme {
12 template<typename T>
13 class PPoint;
14
21 template<typename T>
22 class PLine : public PObject<T> {
23 public:
24 PLine(T a = T(0), T b = T(0), T c = T(1)) : PObject<T>(a, b, c) {}
25 PLine(const PObject<T>& other) : PObject<T>(other.getX(), other.getY(), other.getZ()) {}
26 bool operator==(const PLine<T>& other) const {
27 return this->equals(other);
28 }
29
30 bool operator!=(const PLine<T>& other) const {
31 return !this->equals(other);
32 }
33 bool operator<(const PLine<T>& other) const {
34 return this->less(other);
35 }
36
38
43 PPoint<T> operator*(const PLine<T>& other) const {
44 return PPoint<T>(this->op(other));
45 }
46
48
53 bool has(const PPoint<T>& pnt) const {
54 return this->incident(pnt);
55 }
56 };
57
59 template<typename T>
60 ostream& operator<<(ostream& os, const PLine<T>& P) {
61 os << "[" << P.getX() << "," << P.getY() << "," << P.getZ() << "]";
62 return os;
63 }
64
66 template<typename T>
67 bool concurrent(const PLine<T>& A, const PLine<T>& B, const PLine<T>& C) {
68 return dependent(A, B, C);
69 }
70}
71
72#endif
PPoint< T > operator*(const PLine< T > &other) const
Metszéspont meghatározása.
Definition pline.hpp:43
bool has(const PPoint< T > &pnt) const
Illeszkedés vizsgálata.
Definition pline.hpp:53
bool operator<(const PLine< T > &other) const
Definition pline.hpp:33
bool operator!=(const PLine< T > &other) const
Definition pline.hpp:30
bool operator==(const PLine< T > &other) const
Definition pline.hpp:26
PLine(const PObject< T > &other)
Definition pline.hpp:25
PLine(T a=T(0), T b=T(0), T c=T(1))
Definition pline.hpp:24
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
Definition pline.hpp:11
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
bool concurrent(const PLine< T > &A, const PLine< T > &B, const PLine< T > &C)
Megvizsgálja, hogy három egyenes egy pontban metszi-e egymást.
Definition pline.hpp:67
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.