## (a) class MbVec4f

### Public Methods

float dot(const MbVec4f &v)
Returns dot (inner) product of vector and another vector
MbBool equals(const MbVec4f v, float tolerance)
length of the maximum distance between the two vectors
void getValue(float &x, float &y, float &z, float &a)
Returns 4 individual components
const float* getValue()
Returns pointer to array of 4 components
float length()
Returns geometric length of vector
MbVec4f(const float v[4])
Constructor given an array of 3 components
MbVec4f(float x, float y, float z, float a)
Constructor given 3 individual components
void negate()
Negates each component of vector in place
float normalize()
Changes vector to be unit length
friend int operator !=(const MbVec4f &v1, const MbVec4f &v2)
friend MbVec4f operator *(float d, const MbVec4f &v)
friend MbVec4f operator *(const MbVec4f &v, float d)
Component-wise binary scalar multiplication and division operators
MbVec4f& operator *=(float d)
Component-wise scalar multiplication and division operators
friend MbVec4f operator +(const MbVec4f &v1, const MbVec4f &v2)
Component-wise binary vector addition and subtraction operators
MbVec4f& operator +=(MbVec4f v)
Component-wise vector addition and subtraction operators
friend MbVec4f operator -(const MbVec4f &v1, const MbVec4f &v2)
MbVec4f operator -()
Nondestructive unary negation - returns a new vector
MbVec4f& operator -=(MbVec4f v)
friend MbVec4f operator /(const MbVec4f &v, float d)
MbVec4f& operator /=(float d)
friend int operator ==(const MbVec4f &v1, const MbVec4f &v2)
Equality comparison operator
const float& operator [](int i)
float& operator [](int i)
Accesses indexed component of vector
MbVec4f& setValue(float x, float y, float z, float a)
Sets value of vector from 3 individual components
MbVec4f& setValue(const float v[4])
Sets value of vector from array of 3 components
~MbVec4f()

float vec[4]

## Documentation

~MbVec4f()

MbVec4f(const float v[4])
Constructor given an array of 3 components

MbVec4f(float x, float y, float z, float a)
Constructor given 3 individual components

float dot(const MbVec4f &v)
Returns dot (inner) product of vector and another vector

const float* getValue()
Returns pointer to array of 4 components

void getValue(float &x, float &y, float &z, float &a)
Returns 4 individual components

float length()
Returns geometric length of vector

float normalize()
Changes vector to be unit length

void negate()
Negates each component of vector in place

MbVec4f& setValue(const float v[4])
Sets value of vector from array of 3 components

MbVec4f& setValue(float x, float y, float z, float a)
Sets value of vector from 3 individual components

float& operator [](int i)
Accesses indexed component of vector

const float& operator [](int i)

MbVec4f& operator *=(float d)
Component-wise scalar multiplication and division operators

MbVec4f& operator /=(float d)

MbVec4f& operator +=(MbVec4f v)
Component-wise vector addition and subtraction operators

MbVec4f& operator -=(MbVec4f v)

MbVec4f operator -()
Nondestructive unary negation - returns a new vector

friend MbVec4f operator *(const MbVec4f &v, float d)
Component-wise binary scalar multiplication and division operators

friend MbVec4f operator *(float d, const MbVec4f &v)

friend MbVec4f operator /(const MbVec4f &v, float d)

friend MbVec4f operator +(const MbVec4f &v1, const MbVec4f &v2)
Component-wise binary vector addition and subtraction operators

friend MbVec4f operator -(const MbVec4f &v1, const MbVec4f &v2)

friend int operator ==(const MbVec4f &v1, const MbVec4f &v2)
Equality comparison operator

friend int operator !=(const MbVec4f &v1, const MbVec4f &v2)

MbBool equals(const MbVec4f v, float tolerance)
length of the maximum distance between the two vectors

float vec[4]

This class has no child classes.