This is the Vector3D class.
More...
#include <vector.h>
|
float | x |
|
float | y |
|
float | z |
| Coordinates of a vector.
|
|
This is the Vector3D class.
This class instantiates a Vector3D object and with basic overload math expression that can be done with Vector in 3D
◆ Vector3D() [1/3]
csci3081::Vector3D::Vector3D |
( |
float |
x_ = 0 , |
|
|
float |
y_ = 0 , |
|
|
float |
z_ = 0 |
|
) |
| |
Constructor. This sets up an instance of Vector3D with 3 coordinates as arguments.
- Parameters
-
[in] | x_ | float, x-coordinate |
[in] | y_ | float, y-coordinate |
[in] | z_ | float, z-coordinate |
◆ Vector3D() [2/3]
csci3081::Vector3D::Vector3D |
( |
std::vector< float > |
arg | ) |
|
Constructor. This sets up an instance of Vector3D with 3 coordinates as arguments.
- Parameters
-
[in] | arg | std::vector<float> that stores coordinates |
◆ Vector3D() [3/3]
csci3081::Vector3D::Vector3D |
( |
const Vector3D & |
copy | ) |
|
Copy Constructor. This creates a new instance of Vector3D that has the same content as the Vector3D argument.
- Parameters
-
[in] | copy | Vector3D instance that wants to be copied |
◆ operator*()
Vector3D csci3081::Vector3D::operator* |
( |
float |
other | ) |
|
overloading operator * to do multiply a Vector3D instance to a float
- Parameters
-
other | float factor that want to multiply the Vector3D with |
◆ operator+()
overloading operator + to do addition between Vector3D instances
- Parameters
-
other | the right hand side Vector3D of the addition |
◆ operator-()
overloading operator - to do addition between Vector3D instances
- Parameters
-
other | the right hand side Vector3D of the subtraction |
◆ operator/()
Vector3D csci3081::Vector3D::operator/ |
( |
float |
other | ) |
|
overloading operator / to do division a Vector3D instance to a float
- Parameters
-
other | float factor that want to divide the Vector3D with |
◆ operator=()
overloading operator = to copy one Vector3D to another
- Parameters
-
cpy | the Vector3D object that wants to copy |
◆ Print()
void csci3081::Vector3D::Print |
( |
| ) |
|
|
virtual |
Function to print the coordinate of a vector instance.
Implements csci3081::Vector.
◆ SetY()
void csci3081::Vector3D::SetY |
( |
float |
y_ | ) |
|
This function uses to set y coordinator of a vector instance.
- Parameters
-
y_ | float, new y-coordinate |
The documentation for this class was generated from the following files:
- /home/user/repo/project/include/vector.h
- /home/user/repo/project/src/vector.cc