class MbVec2f


Public Methods

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

Protected Fields

float vec[2]

Documentation

MbVec2f(const float v[2])
Constructor given an array of 2 components

MbVec2f(float x, float y)
Constructor given 2 individual components

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

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

void getValue(float &x, float &y)
Returns 2 individual components

float length()
Returns geometric length of vector

void negate()
Negates each component of vector in place

float normalize()
Changes vector to be unit length

MbVec2f& setValue(const float v[2])
Sets value of vector from array of 2 components

MbVec2f& setValue(float x, float y)
Sets value of vector from 2 individual components

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

const float& operator [](int i)

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

MbVec2f& operator /=(float d)

MbVec2f& operator +=(const MbVec2f &u)
Component-wise vector addition and subtraction operators

MbVec2f& operator -=(const MbVec2f &u)

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

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

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

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

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

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

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

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

MbBool equals(const MbVec2f v, float tolerance)
Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors

float vec[2]


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de