Flow123d  jenkins-Flow123d-linux-release-multijob-282
myvector.h
Go to the documentation of this file.
1 #ifndef vectorH
2 #define vectorH
3 
4 class TPoint;
5 
6 
7 class TVector {
8 protected:
9  static int numberInstance;
10  int id;
11 
12  double coors[ 3 ];
13  double length;
14 
15  int generateId();
16 
17  void Compute();
18  void CompLength();
19 
20 public:
21  TVector();
22  TVector(double, double, double);
24  TVector(const TVector &);
25  ~TVector();
26 
27  double Length() const;
28  void Get(double&, double&, double&) const;
29  void Get(double*) const;
30  double Get(int) const;
31  void SetVector(double, double, double);
32  bool IsZero();
33 
34  double X1() const;
35  double X2() const;
36  double X3() const;
37 
38  TVector & operator =(const TPoint&);
39  TVector operator +(const TVector&);
40  TVector operator +(const TPoint&);
41  TVector operator -(const TVector&);
42  friend TVector operator*(const TVector&, double);
43  friend TVector operator*(double, const TVector&);
44  bool operator ==(const TVector&);
45 
46  static int getNumInstances() {
48  }
49 };
50 
51 TVector Cross(const TVector&, const TVector&);
52 double Dot(const TVector&, const TVector&);
53 bool AreParallel(const TVector&, const TVector&);
54 bool ArePerpendicular(const TVector&, const TVector&);
55 
56 #endif
bool ArePerpendicular(const TVector &, const TVector &)
Definition: vector.cpp:225
double X2() const
Definition: vector.cpp:205
TVector & operator=(const TPoint &)
Definition: vector.cpp:67
~TVector()
Definition: vector.cpp:55
double X1() const
Definition: vector.cpp:201
static int getNumInstances()
Definition: myvector.h:46
bool operator==(const TVector &)
Definition: vector.cpp:192
bool AreParallel(const TVector &, const TVector &)
Definition: vector.cpp:213
double length
Definition: myvector.h:13
double X3() const
Definition: vector.cpp:209
TVector()
Definition: vector.cpp:14
int id
Definition: myvector.h:10
Definition: point.h:10
TVector Cross(const TVector &, const TVector &)
Definition: vector.cpp:163
TVector operator+(const TVector &)
Definition: vector.cpp:77
void CompLength()
Definition: vector.cpp:63
friend TVector operator*(const TVector &, double)
Definition: vector.cpp:120
double Length() const
Definition: vector.cpp:140
double coors[3]
Definition: myvector.h:12
bool IsZero()
Definition: vector.cpp:132
void SetVector(double, double, double)
Definition: vector.cpp:113
TVector operator-(const TVector &)
Definition: vector.cpp:101
void Get(double &, double &, double &) const
Definition: vector.cpp:144
double Dot(const TVector &, const TVector &)
Definition: vector.cpp:180
void Compute()
Definition: vector.cpp:59
int generateId()
Definition: vector.cpp:10
static int numberInstance
Definition: myvector.h:9