CSCI 3081 - Drone Delivery System
Public Member Functions | List of all members
csci3081::Vector3D Class Reference

This is the Vector3D class. More...

#include <vector.h>

Inheritance diagram for csci3081::Vector3D:
Inheritance graph

Public Member Functions

 Vector3D (float x_, float y_, float z_)
 Constructor. This sets up an instance of Vector3D with 3 coordinates as arguments. More...
 
 Vector3D (std::vector< float > arg)
 Constructor. This sets up an instance of Vector3D with 3 coordinates as arguments. More...
 
 Vector3D ()
 Constructor. This sets up an instance of Vector3D with zero coordinates.
 
 Vector3D (const Vector3D &)
 Copy Constructor. This creates a new instance of Vector3D that has the same content as the Vector3D argument. More...
 
void SetY (float y_)
 This function uses to set y coordinator of a vector instance. More...
 
Vector3D operator+ (const Vector3D &)
 overloading operator + to do addition between Vector3D instances More...
 
Vector3D operator- (const Vector3D &)
 overloading operator - to do addition between Vector3D instances More...
 
Vector3D operator* (float)
 overloading operator * to do multiply a Vector3D instance to a float More...
 
Vector3D operator/ (float)
 overloading operator / to do division a Vector3D instance to a float More...
 
Vector3Doperator= (const Vector3D &)
 overloading operator = to copy one Vector3D to another More...
 
Vector3D Normalize ()
 This function normalizes a Vector3D instance.
 
void Print ()
 Function to print the coordinate of a vector instance. More...
 
bool IsWithinXandZRange (const Vector3D &, float precision)
 
- Public Member Functions inherited from csci3081::Vector
void SetX (float x_)
 This function uses to set x coordinator of a vector instance.
 
void SetZ (float z_)
 This function uses to set z coordinator of a vector instance.
 
float GetX () const
 This function uses to get x coordinator of a vector instance.
 
float GetZ () const
 This function uses to get z coordinator of a vector instance.
 
float GetY () const
 This function uses to get y coordinator of a vector instance.
 
float Magnitude ()
 This function returns the magitude of a vector instance.
 
bool operator== (const Vector &)
 Convert vector distance to std::vector<float> instances. More...
 

Additional Inherited Members

- Protected Attributes inherited from csci3081::Vector
float x
 
float y
 
float z
 Coordinates of a vector.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ 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]argstd::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]copyVector3D instance that wants to be copied

Member Function Documentation

◆ operator*()

Vector3D csci3081::Vector3D::operator* ( float  other)

overloading operator * to do multiply a Vector3D instance to a float

Parameters
otherfloat factor that want to multiply the Vector3D with

◆ operator+()

Vector3D csci3081::Vector3D::operator+ ( const Vector3D other)

overloading operator + to do addition between Vector3D instances

Parameters
otherthe right hand side Vector3D of the addition

◆ operator-()

Vector3D csci3081::Vector3D::operator- ( const Vector3D other)

overloading operator - to do addition between Vector3D instances

Parameters
otherthe 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
otherfloat factor that want to divide the Vector3D with

◆ operator=()

Vector3D & csci3081::Vector3D::operator= ( const Vector3D cpy)

overloading operator = to copy one Vector3D to another

Parameters
cpythe 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: