#include <vec3.h>
Public Member Functions | |
vec3 () | |
vec3 (double xc, double yc, double zc) | |
void | Normalize () |
double | Length () const |
double | SquaredLength () const |
const vec3 | operator- () const |
void | Flip () |
const vec3 | operator- (const vec3 &vec) const |
const vec3 | operator+ (const vec3 &vec) const |
const vec3 | operator * (double fact) const |
const vec3 | operator/ (double fact) const |
vec3 & | operator *= (double fact) |
Public Attributes | |
double | x |
double | y |
double | z |
Related Functions | |
(Note that these are not member functions.) | |
double | dotprod (const vec3 &v1, const vec3 &v2) |
vec3 | crossprod (const vec3 &a, const vec3 &b) |
std::ostream & | operator<< (std::ostream &os, const vec3 &v) |
Definition at line 44 of file vec3.h.
|
Default constructor. Does not initialize x, y, and z. |
|
Creates a vector with the coordinates xc, yc, and zc. |
|
Normalizes the vector to length 1. |
|
Returns the length of the vector. |
|
Returns the squared length of the vector. |
|
Returns the vector with the signs of all coordinates flipped. |
|
Flips the signs of all coordinates. |
|
Subtracts vec from the vector. |
|
Adds vec to the vector. |
|
Returns the vector scaled by fact. |
|
Returns the vector scaled by 1/fact. |
|
Scales the vector by fact. |
|
x-coordinate |
|
y-coordinate |
|
z-coordinate |