DFNgen  2.0
DFN Model Generator
vectorFunctions.h File Reference
#include <fstream>
#include <string>
#include <iostream>
#include <cmath>
#include "input.h"
#include "structures.h"
Include dependency graph for vectorFunctions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double * projection (const double *v1, const double *v2)
 
double euclideanDistance (double *A, double *B)
 
double euclideanDistance (Point &A, Point &B)
 
double angleBeteenVectors (const double *vector1, const double *vector2)
 
template<typename T >
T * crossProduct (const T *v1, const T *v2)
 
template<typename T >
void normalize (T *vec)
 
template<typename T >
dotProduct (const T *A, const T *B)
 
template<typename T >
void printVertices (T *vert, int numVertices)
 
template<typename T >
magnitude (T x, T y, T z)
 
template<typename T >
sqrMagnitude (T x, T y, T z)
 
bool parallel (double *v1, double *v2)
 

Function Documentation

§ angleBeteenVectors()

double angleBeteenVectors ( const double *  vector1,
const double *  vector2 
)

Definition at line 74 of file vectorFunctions.cpp.

Here is the call graph for this function:

§ crossProduct()

template<typename T >
T* crossProduct ( const T *  v1,
const T *  v2 
)
inline

Calculates crossproduct of v1 and v2 Arg 1: Pointer to array of three elements Arg 2: Pointer to array of three elements Return: Pointer to cross product, array of three elements NOTE: must use delete[] on returned pointer after use.

Definition at line 24 of file vectorFunctions.h.

Here is the caller graph for this function:

§ dotProduct()

template<typename T >
T dotProduct ( const T *  A,
const T *  B 
)
inline

Calculates the dot product of vector A with B Arg 1: Pointer to array of three elements Arg 2: Pointer to array of three elements Return: Pointer to dot product, array of three elements NOTE: Must use delete[] on returned pointer after use

Definition at line 58 of file vectorFunctions.h.

Here is the caller graph for this function:

§ euclideanDistance() [1/2]

double euclideanDistance ( double *  A,
double *  B 
)

Definition at line 46 of file vectorFunctions.cpp.

Here is the caller graph for this function:

§ euclideanDistance() [2/2]

double euclideanDistance ( Point A,
Point B 
)

Definition at line 57 of file vectorFunctions.cpp.

§ magnitude()

template<typename T >
T magnitude ( x,
y,
z 
)
inline

Calculates magnitude of a vector Arg 1: x Arg 2: y Arg 3: z Return: Magnitude of {x,y,z}

Definition at line 86 of file vectorFunctions.h.

Here is the caller graph for this function:

§ normalize()

template<typename T >
void normalize ( T *  vec)
inline

Normalizes vector passed into fucntion. Arg 1: Vector (3 element array) to be normalized.

Definition at line 36 of file vectorFunctions.h.

Here is the caller graph for this function:

§ parallel()

bool parallel ( double *  v1,
double *  v2 
)
inline

Check if two vectors are parallel Arg 1: Pointer to vector 1, array of three doubles Arg 2: Pointer to vector 2, array of three doubles Output: True if vectors are parallel False otherwise

Definition at line 109 of file vectorFunctions.h.

Here is the call graph for this function:
Here is the caller graph for this function:

§ printVertices()

template<typename T >
void printVertices ( T *  vert,
int  numVertices 
)

Prints vertices with {x, y, z} format. Arg 1: Pointer to vertice array. Expects array length to be a multple of three Arg 2: Number of vertices in array

Definition at line 70 of file vectorFunctions.h.

§ projection()

double* projection ( const double *  v1,
const double *  v2 
)

Definition at line 20 of file vectorFunctions.cpp.

Here is the caller graph for this function:

§ sqrMagnitude()

template<typename T >
T sqrMagnitude ( x,
y,
z 
)
inline

Calculates the square magnitude of a vector Arg 1: x Arg 2: y Arg 3: z Return: Square magnitude of {x,y,z}

Definition at line 98 of file vectorFunctions.h.

Here is the caller graph for this function: