|
HIPO
4.3.0
High Performance Output data format for experimental physics
|
Three-dimensional Cartesian vector. More...
#include <fizika.h>
Public Member Functions | |
| vector3 () | |
| Default constructor (uninitialized components). More... | |
| vector3 (double x, double y, double z) | |
| Construct from Cartesian components. More... | |
| ~vector3 () | |
| void | setXYZ (double x, double y, double z) |
| Set the Cartesian components. More... | |
| void | setMagThetaPhi (double mag, double theta, double phi) |
| Set the vector from spherical coordinates. More... | |
| double | theta () const |
| double | phi () const |
| double | perp () const |
| double | perp2 () const |
| double | mag2 () const |
| double | mag () const |
| double | x () const |
| double | y () const |
| double | z () const |
| void | setX (double _x) |
| Set the X component. More... | |
| void | setY (double _y) |
| Set the Y component. More... | |
| void | setZ (double _z) |
| Set the Z component. More... | |
| double | angle (const vector3 &q) |
| Compute the angle between this vector and another. More... | |
| void | rotateX (double angle) |
| Rotate the vector around the X axis. More... | |
| void | rotateY (double angle) |
| Rotate the vector around the Y axis. More... | |
| void | rotateZ (double angle) |
| Rotate the vector around the Z axis. More... | |
| vector3 | unit () const |
| vector3 | cross (const vector3 &vec) const |
| Compute the cross product with another vector. More... | |
| double | dot (const vector3 &vec) const |
| Compute the dot product with another vector. More... | |
| void | print (const char *_line="V3 ") |
| Print the vector components and magnitude to stdout. More... | |
| const vector3 & | operator= (const vector3 &vec) |
| Copy-assignment operator. More... | |
| vector3 & | operator+= (const vector3 &) |
| Add another vector to this one in place. More... | |
| vector3 & | operator-= (const vector3 &) |
| Subtract another vector from this one in place. More... | |
Three-dimensional Cartesian vector.
Supports basic vector algebra (addition, subtraction, scalar multiplication), rotations around the coordinate axes, and conversions to spherical coordinates.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| vector3 fizika::vector3::unit | ( | ) | const |
|
inline |
|
inline |
|
inline |