class methods

- ofVec4f()
- average()
- distance()
- dot()
- getInterpolated()
- getLimited()
- getMiddle()
- getNormalized()
- getPtr()
- getScaled()
- interpolate()
- length()
- lengthSquared()
- limit()
- match()
- middle()
- normalize()
- one()
- operator!=()
- operator*()
- operator*=()
- operator+()
- operator+=()
- operator-()
- operator-=()
- operator/()
- operator/=()
- operator==()
- operator[]()
- scale()
- set()
- squareDistance()
- zero()

variables

global functions

# average(...)

## ofVec4f & ofVec4f::average(const ofVec4f *points, int num)

*Documentation from code comments*

*Documentation from code comments*

Sets this vector to be the average (center of gravity or centroid) of a given array of 'ofVec4f's.

Parameters: points The array of 'ofVec4f's used in the average calculation. num The number of ofVec4f objects in the array.

# distance(...)

## float ofVec4f::distance(const ofVec4f &pnt)

*Documentation from code comments*

*Documentation from code comments*

Treats this vector and 'pnt' as points in 4D space and calculates the distance between them.

Parameters: pnt The vector used in the distance calculation with the current vector.

Returns: The distance between the two vectors in 4D space.

# dot(...)

## float ofVec4f::dot(const ofVec4f &vec)

*Documentation from code comments*

*Documentation from code comments*

Calculates and returns the dot product of this vector with 'vec'.

Dot product (less commonly known as Euclidean inner product) expresses the angular relationship between two vectors. In other words it is a measure of how parallel two vectors are. If they are completely perpendicular the dot product is 0; if they are completely parallel their dot product is either 1 if they are pointing in the same direction, or -1 if they are pointing in opposite directions.

Parameters: vec The vector used in the dot product calculation with this vector.

Returns: The dot product of this vector with 'vec'.

# getInterpolated(...)

## ofVec4f ofVec4f::getInterpolated(const ofVec4f &pnt, float p)

*Documentation from code comments*

*Documentation from code comments*

Performs a linear interpolation of this vector towards 'pnt'.

Parameters: pnt The vector the interpolation will be performed on. p The amount to move towards 'pnt'; 'p' is normally between 0 and 1 and where 0 means stay the original position and 1 means move all the way to 'pnt', but you can also have 'p' greater than 1 overshoot 'pnt', or less than 0 to move backwards away from 'pnt'.

Returns: The interpolation as an ofVec4f.

# getLimited(...)

## ofVec4f ofVec4f::getLimited(float max)

*Documentation from code comments*

*Documentation from code comments*

Returns a copy of this vector with its length (magnitude) restricted to a maximum of 'max' units by scaling down if necessary.

Parameters: max The maximum length of the new vector.

Returns: A copy of the current vector that is at most 'max' units long.

# getMiddle(...)

## ofVec4f ofVec4f::getMiddle(const ofVec4f &pnt)

*Documentation from code comments*

*Documentation from code comments*

Calculates and returns the midpoint (as a vector) between this vector and 'pnt'.

Parameters: pnt The vector used in the midpoint calculation with this vector.

Returns: The midpoint between this vector and 'pnt' as an ofVec4f.

# getNormalized()

## ofVec4f ofVec4f::getNormalized()

*Documentation from code comments*

*Documentation from code comments*

Returns a normalized copy of this vector.

Normalization means to scale the vector so that its length (magnitude) is exactly 1, at which stage all that is left is the direction. A normalized vector is usually called a unit vector, and can be used to represent a pure direction (heading).

Returns: The normalized copy of the current vector.

# getScaled(...)

## ofVec4f ofVec4f::getScaled(const float length)

# interpolate(...)

## ofVec4f & ofVec4f::interpolate(const ofVec4f &pnt, float p)

*Documentation from code comments*

*Documentation from code comments*

Performs a linear interpolation of this vector towards 'pnt'. This modifies the current vector to the interpolated value.

Parameters: pnt The vector the interpolation will be performed on. p The amount to move towards 'pnt'; 'p' is normally between 0 and 1 and where 0 means stay the original position and 1 means move all the way to 'pnt', but you can also have 'p' greater than 1 overshoot 'pnt', or less than 0 to move backwards away from 'pnt'.

# length()

## float ofVec4f::length()

*Documentation from code comments*

*Documentation from code comments*

Returns the length (magnitude) of this vector.

Returns: The magnitude of the current vector.

# limit(...)

## ofVec4f & ofVec4f::limit(float max)

*Documentation from code comments*

*Documentation from code comments*

Restrict the length (magnitude) of this vector to a maximum of 'max' units by scaling down if necessary.

Parameters: max The maximum length of the current vector.

# middle(...)

## ofVec4f & ofVec4f::middle(const ofVec4f &pnt)

*Documentation from code comments*

*Documentation from code comments*

Calculates and returns the midpoint (as a vector) between this vector and 'pnt'. This modifies the current vector to the midpoint value.

Parameters: pnt The vector used in the midpoint calculation with this vector.

Returns: The midpoint between this vector and 'pnt' as an ofVec4f.

# normalize()

## ofVec4f & ofVec4f::normalize()

*Documentation from code comments*

*Documentation from code comments*

Normalizes the vector. This changes the current vector to its normalized value.

Normalization means to scale the vector so that its length (magnitude) is exactly 1, at which stage all that is left is the direction. A normalized vector is usually called a unit vector, and can be used to represent a pure direction (heading).

# operator+(...)

## ofVec4f ofVec4f::operator+(const ofVec4f &vec)

*Documentation from code comments*

*Documentation from code comments*

\name Operators {

# operator==(...)

## bool ofVec4f::operator==(const ofVec4f &vec)

*Documentation from code comments*

*Documentation from code comments*

\name Comparison {

# scale(...)

## ofVec4f & ofVec4f::scale(const float length)

*Documentation from code comments*

*Documentation from code comments*

Scales this vector up or down so that it has the requested length.

Parameters: length The desired length of the vector.

# operator

## ostream & operator

Last updated Monday, 20 March 2017 11:57:06 UTC - b2cbe76c951cd2bce616e17af14c9ab4dbf4009a

Hosting for openFrameworks is generously provided by Rackspace

If you have any doubt about the usage of this module you can ask in the forum.

If you want to contribute better documentation or start documenting this section you can do so here

If you find anything wrong with this docs you can report any error by opening an issue