#include <MyVector.h>
This is the class of Vectors. The Vectors 3 dimensional and the components are double.
Definition at line 53 of file MyVector.h.
Public Member Functions | |
| Vector () | |
| The default constructor. | |
| Vector (double _x, double _y, double _z) | |
| An overloaded constructor. | |
| void | operator= (Vector const &otherVec) |
| The overloaded assignment operator. | |
| double | operator[] (unsigned int index) |
| The overloaded indexing operator []. | |
| Vector & | operator+ (Vector const &otherVec) |
| The overloaded addition operator. | |
| Vector & | operator- (Vector const &otherVec) |
| The overloaded subtraction operator. | |
| Vector & | operator * (double scalar) |
| This is the overloaded * operator. | |
| double | operator * (Vector const &otherVec) |
| This is yet again the * operator overloaded. | |
| double | norm () |
| The function which return the norm of the vector. | |
| void | print () |
| The function which dumps the vector to the std::cout stream. | |
|
|
The default constructor. Using this constructor to create a Vector object results in a Vector whose components are initialized to zero. |
|
||||||||||||||||
|
An overloaded constructor. An overloaded constructor taking as arguments
|
|
|
The function which return the norm of the vector.
|
|
|
This is yet again the * operator overloaded. This time the * operator is overloaded to do the dot product of two vectors. |
|
|
This is the overloaded * operator. This operator multiplies a scalar with a vector. |
|
|
The overloaded addition operator. This is to obviously add two vectors. |
|
|
The overloaded subtraction operator. This is to obviously subtract two vectors. |
|
|
The overloaded assignment operator. This is the overloaded assignment operator and essentially copies the x ,y and z values from the otherVec. |
|
|
The overloaded indexing operator []. This operator is for accessing the individual components of a Vector. This method throws an exception which is an object of class MyMathException. |
|
|
The function which dumps the vector to the std::cout stream.
|
1.3.6