# vec3 Class Reference

`#include <vec3.h>`

List of all members.

## Public Member Functions
| vec3 ()
| vec3 (float x, float y, float z=0.0f)
| vec3 (const float *u)
| vec3 (const vec3 &)
float & | operator[] (unsigned)
| returns an element of the vector
vec3 & | operator= (const vec3 &)
| assignment operator
vec3 & | operator+= (const vec3 &)
| adds the input vector to this one
vec3 & | operator-= (const vec3 &)
| subtracts the input vector from this one
vec3 & | operator*= (float)
| scales this vector with the scalar
vec3 & | operator/= (float)
| scales this vector with the inverse of the scalar
const vec3 | operator+ (const vec3 &) const
| adds two vectors
const vec3 | operator- (const vec3 &) const
| subtracts two vectors
const vec3 | operator* (float) const
| scales the vector with the scalar
const vec3 | operator/ (float) const
| scales the vector with the inverse of the scalar
bool | operator== (const vec3 &) const
| returns true if the vectors are equal
bool | operator!= (const vec3 &) const
| returns true if the vectors differ in at least one component
vec3 & | operator- ()
| opposite vector
float | norm () const
| norm of the vector (length*length)
float | length () const
| length of the vector
vec3 & | operator! ()
| normalizes the vector
float | dist2 (const vec3 &)
| norm of the vectors' difference (dist*dist)
float | dist (const vec3 &)
| length of the vectors' difference
float | operator* (const vec3 &) const
| dot product
const vec3 | operator^ (const vec3 &) const
| cross product
void | print ()
| print the vector components
## Public Attributes
union {
float v [3]
struct {
float x
float y
float z
} |
}; |
| our vector data

## Constructor & Destructor Documentation

vec3::vec3 | ( |  | ) |

vec3::vec3 | ( | float | x,
|  | float | y,
|  | float | z = `0.0f` |
| ) |  |  |

vec3::vec3 | ( | const float * | u | ) |

vec3::vec3 | ( | const vec3 & | u | ) |

## Member Function Documentation

float vec3::dist | ( | const vec3 & | u | ) |

length of the vectors' difference

float vec3::dist2 | ( | const vec3 & | u | ) |

norm of the vectors' difference (dist*dist)

float vec3::length | ( |  | ) | const`[inline]`

length of the vector

float vec3::norm | ( |  | ) | const`[inline]`

norm of the vector (length*length)

vec3 & vec3::operator! | ( |  | ) |

normalizes the vector

bool vec3::operator!= | ( | const vec3 & | u | ) | const

returns true if the vectors differ in at least one component

float vec3::operator* | ( | const vec3 & | u | ) | const

dot product

const vec3 vec3::operator* | ( | float | t | ) | const

scales the vector with the scalar

vec3 & vec3::operator*= | ( | float | t | ) |

scales this vector with the scalar

const vec3 vec3::operator+ | ( | const vec3 & | u | ) | const

adds two vectors

vec3 & vec3::operator+= | ( | const vec3 & | u | ) |

adds the input vector to this one

vec3 & vec3::operator- | ( |  | ) |

opposite vector

const vec3 vec3::operator- | ( | const vec3 & | u | ) | const

subtracts two vectors

vec3 & vec3::operator-= | ( | const vec3 & | u | ) |

subtracts the input vector from this one

const vec3 vec3::operator/ | ( | float | t | ) | const

scales the vector with the inverse of the scalar

vec3 & vec3::operator/= | ( | float | t | ) |

scales this vector with the inverse of the scalar

vec3 & vec3::operator= | ( | const vec3 & | u | ) |

assignment operator

bool vec3::operator== | ( | const vec3 & | u | ) | const

returns true if the vectors are equal

float & vec3::operator[] | ( | unsigned | i | ) |

returns an element of the vector

const vec3 vec3::operator^ | ( | const vec3 & | u | ) | const

cross product

void vec3::print | ( |  | ) |

print the vector components

## Member Data Documentation

union { ... }

our vector data

float vec3::v[3]

float vec3::x

float vec3::y

float vec3::z

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

- F:/Meine Dateien/Visual Studio 2005/Projects/InsightFlow/header/vec3.h
- F:/Meine Dateien/Visual Studio 2005/Projects/InsightFlow/src/vec3.cpp