CSCI 3081 - Drone Delivery System
Public Member Functions | Protected Attributes | Friends | List of all members
csci3081::Vector Class Referenceabstract

This is the interface class for the Vector3D and Vector2D classes. More...

#include <vector.h>

Inheritance diagram for csci3081::Vector:
Inheritance graph

Public Member Functions

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...
 
virtual void Print ()=0
 Function to print the coordinate of a vector instance.
 

Protected Attributes

float x
 
float y
 
float z
 Coordinates of a vector.
 

Friends

float DotProduct (const Vector &v1, const Vector &v2)
 Compute the dot product (float variable) between two vectors instances. More...
 
float Distance (const Vector &v1, const Vector &v2)
 Compute the distance (float variable) between two vectors instances. More...
 
std::vector< float > toVectorFloat (Vector &v)
 Convert vector distance to std::vector<float> instances. More...
 

Detailed Description

This is the interface class for the Vector3D and Vector2D classes.

This class will set up (virtual) common methods as well as attributes shared by both Vector3D and vector2D class. Also has some friends functions to find relationship between more than one vector instances

Member Function Documentation

◆ operator==()

bool csci3081::Vector::operator== ( const Vector other)

Convert vector distance to std::vector<float> instances.

Parameters
[in]vVector instance
Returns
True if argument vector is equal to current object False otherwise

Friends And Related Function Documentation

◆ Distance

float Distance ( const Vector v1,
const Vector v2 
)
friend

Compute the distance (float variable) between two vectors instances.

Parameters
[in]v1Vector instance
[in]v2Vector instance
Returns
float Distance of v1 and v2

◆ DotProduct

float DotProduct ( const Vector v1,
const Vector v2 
)
friend

Compute the dot product (float variable) between two vectors instances.

Parameters
[in]v1Vector instance
[in]v2Vector instance
Returns
float Dot product of v1 and v2

◆ toVectorFloat

std::vector<float> toVectorFloat ( Vector v)
friend

Convert vector distance to std::vector<float> instances.

Parameters
[in]vVector instance
Returns
std::vector<float> Have x,y,z as its elements

The documentation for this class was generated from the following files: