This is the Vector2D class.
More...
#include <vector.h>
|
float | x |
|
float | y |
|
float | z |
| Coordinates of a vector.
|
|
This is the Vector2D class.
This class instantiates a Vector2D object and with basic overload math expression that can be done with Vector in 2D
◆ Vector2D() [1/3]
csci3081::Vector2D::Vector2D |
( |
std::vector< float > |
arg | ) |
|
Constructor. This sets up an instance of Vector2D with 2 coordinates as arguments.
- Parameters
-
[in] | arg | std::vector<float> that stores coordinates |
◆ Vector2D() [2/3]
csci3081::Vector2D::Vector2D |
( |
float |
x_, |
|
|
float |
z_ |
|
) |
| |
Constructor. This sets up an instance of Vector3D with 3 coordinates as arguments.
- Parameters
-
[in] | x_ | float, x-coordinate |
[in] | z_ | float, z-coordinate |
◆ Vector2D() [3/3]
csci3081::Vector2D::Vector2D |
( |
const Vector2D & |
copy | ) |
|
Copy Constructor. This creates a new instance of Vector2D that has the same content as the Vector2D argument.
- Parameters
-
[in] | copy | Vector2D instance that wants to be copied |
◆ operator*()
Vector2D csci3081::Vector2D::operator* |
( |
float |
other | ) |
|
overloading operator * to do multiply a Vector2D instance to a float
- Parameters
-
other | float factor that want to multiply the Vector2D with |
◆ operator+()
overloading operator + to do addition between Vector2D instances
- Parameters
-
other | the right hand side Vector2D of the addition |
◆ operator-()
overloading operator - to do addition between Vector2D instances
- Parameters
-
other | the right hand side Vector2D of the subtraction |
◆ operator/()
Vector2D csci3081::Vector2D::operator/ |
( |
float |
other | ) |
|
overloading operator / to do division a Vector2D instance to a float
- Parameters
-
other | float factor that want to divide the Vector2D with |
◆ operator=()
overloading operator = to copy one Vector2D to another
- Parameters
-
cpy | the Vector2D object that wants to copy |
◆ Print()
void csci3081::Vector2D::Print |
( |
| ) |
|
|
virtual |
Function to print the coordinate of a vector instance.
Implements csci3081::Vector.
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