|
CMU462 Library
1.0
15-462/15-662: Computer Graphics (Fall 2015)
|
Defines 4D standard vectors. More...
#include <vector4D.h>
Inherited by CMU462::Quaternion.
Public Member Functions | |
| Vector4D () | |
| Constructor. More... | |
| Vector4D (double x, double y, double z, double w) | |
| Constructor. More... | |
| Vector4D (double x, double y, double z) | |
| Constructor. More... | |
| Vector4D (double c) | |
| Constructor. More... | |
| Vector4D (const Vector4D &v) | |
| Constructor. More... | |
| Vector4D (const Vector3D &v) | |
| Constructor. More... | |
| Vector4D (const Vector3D &v, double w) | |
| Constructor. More... | |
| double | norm (void) const |
| Returns Euclidean distance metric extended to 4 dimensions. | |
| double | norm2 (void) const |
| Returns Euclidean length squared. | |
| Vector4D | unit (void) const |
| Returns unit vector. More... | |
| void | normalize (void) |
| Divides by Euclidean length. More... | |
| Vector3D | to3D () |
| Converts this vector to a 3D vector ignoring the w component. | |
| Vector3D | projectTo3D () |
| Converts this vector to a 3D vector by dividing x, y, and z by w. | |
Defines 4D standard vectors.
|
inline |
Constructor.
Initializes tp vector (0,0,0, 0).
|
inline |
Constructor.
Initializes to vector (x,y,z,w).
|
inline |
Constructor.
Initializes to vector (x,y,z,0).
|
inline |
Constructor.
Initializes to vector (c,c,c,c)
|
inline |
Constructor.
Initializes from existing vector4D.
|
inline |
Constructor.
Initializes from existing vector3D.
|
inline |
Constructor.
Initializes from existing vector3D and w value.
|
inline |
Returns unit vector.
(returns the normalized copy of this vector.)
|
inline |
Divides by Euclidean length.
This vector will be of unit length i.e. "normalized" afterwards.
1.8.9.1