|
liba 0.1.15
An algorithm library based on C/C++
|
instance structure for three-dimensional vector More...
#include <vector3.h>
Public Member Functions | |
| void | set (a_point3 const &p, a_point3 const &q) |
| set a 3D vector as the difference from point p to point q. | |
| a_real | set_dir (a_real x_, a_real y_, a_real z_) |
| set the components of a 3D vector and normalize it in place. | |
| void | val (a_real &x_, a_real &y_, a_real &z_) const |
| get the cartesian coordinates of a 3D vector. | |
| void | set_val (a_real x_, a_real y_, a_real z_) |
| set the cartesian coordinates of a 3D vector. | |
| void | cyl (a_real &rho, a_real &theta, a_real &z_) const |
| get the cylindrical coordinates of a 3D vector. | |
| void | set_cyl (a_real rho, a_real theta, a_real z_) |
| set the cylindrical coordinates of a 3D vector. | |
| void | sph (a_real &rho, a_real &theta, a_real &alpha) const |
| get the spherical coordinates of a 3D vector. | |
| void | set_sph (a_real rho, a_real theta, a_real alpha) |
| set the spherical coordinates of a 3D vector. | |
| void | add (a_vector3 const &rhs, a_vector3 &res) const |
| add a 3D vector to a 3D vector. | |
| void | sub (a_vector3 const &rhs, a_vector3 &res) const |
| subtract a 3D vector from a 3D vector. | |
| void | mul (a_real rhs, a_vector3 &res) const |
| multiplie a 3D vector by a scalar. | |
| void | div (a_real rhs, a_vector3 &res) const |
| divide a 3D vector by a scalar. | |
| void | neg (a_vector3 &res) const |
| negate a 3D vector. | |
| a_real | unit () |
| normalize a 3D vector in-place to unit length. | |
| a_real | norm () const |
| compute the magnitude of a 3D vector. | |
| a_real | norm2 () const |
| compute the squared magnitude of a 3D vector. | |
| a_real | dot (a_vector3 const &rhs) const |
| compute the dot product (scalar product) of two 3D vectors. | |
| a_real | dist (a_vector3 const &rhs) const |
| compute the distance between two 3D vectors. | |
| a_real | dist2 (a_vector3 const &rhs) const |
| compute the squared distance between two 3D vectors. | |
| a_real | angle (a_vector3 const &rhs) const |
| compute the angle between two 3D vectors in radians. | |
| a_bool | isver (a_vector3 const &rhs) const |
| check if two 3D vectors are orthogonal. | |
| a_bool | ispar (a_vector3 const &rhs) const |
| check if two 3D vectors are parallel or anti-parallel. | |
| void | cross (a_vector3 const &rhs, a_vector3 &res) const |
| compute the cross product (vector product) of two 3D vectors | |
| void | outer (a_vector3 const &rhs, a_real res[9]) const |
| compute the outer product (tensor product) of two 3D vectors. | |
| int | ortho (a_vector3 &u, a_vector3 &v) const |
| construct an orthonormal basis from a given 3D direction vector. | |
| int | proj (a_vector3 const &dir, a_vector3 &res) const |
| project vector onto the direction of vector. | |
| int | perp (a_vector3 const &dir, a_vector3 &res) const |
| project vector onto the plane perpendicular to normal vector. | |
| int | refl (a_vector3 const &dir, a_vector3 &res) const |
| reflect vector across the plane perpendicular to normal vector. | |
| int | sym1 (a_vector3 const &dir, a_vector3 &res) const |
| reflect vector across the line with direction vector. | |
| void | rot (a_vector3 const &dir, a_real angle, a_vector3 &res) const |
| rotate a 3D vector around an arbitrary unit axis using Rodrigues' rotation formula. | |
| void | rot (a_vector3 const &dir, a_real sin, a_real cos, a_vector3 &res) const |
| rotate a 3D vector around an arbitrary unit axis using Rodrigues' rotation formula. | |
Static Public Member Functions | |
| static void | rot2d (a_vector3 const &iu, a_vector3 const &iv, a_real angle, a_vector3 &ou, a_vector3 &ov) |
| rotate a 2D basis in the plane spanned by two orthogonal vectors. | |
Data Fields | |
| a_real | x |
| a_real | y |
| a_real | z |
Friends | |
| a_vector3 | operator^ (a_vector3 const &lhs, a_vector3 const &rhs) |
| compute the cross product (vector product) of two 3D vectors | |
| void | operator+= (a_vector3 &lhs, a_vector3 const &rhs) |
| add a 3D vector to a 3D vector. | |
| a_vector3 | operator+ (a_vector3 const &lhs, a_vector3 const &rhs) |
| add a 3D vector to a 3D vector. | |
| void | operator-= (a_vector3 &lhs, a_vector3 const &rhs) |
| subtract a 3D vector from a 3D vector. | |
| a_vector3 | operator- (a_vector3 const &lhs, a_vector3 const &rhs) |
| subtract a 3D vector from a 3D vector. | |
| a_real | operator* (a_vector3 const &lhs, a_vector3 const &rhs) |
| compute the dot product (scalar product) of two 3D vectors. | |
| void | operator*= (a_vector3 &lhs, a_real rhs) |
| multiplie a 3D vector by a scalar. | |
| a_vector3 | operator* (a_real lhs, a_vector3 const &rhs) |
| multiplie a 3D vector by a scalar. | |
| a_vector3 | operator* (a_vector3 const &lhs, a_real rhs) |
| multiplie a 3D vector by a scalar. | |
| void | operator/= (a_vector3 &lhs, a_real rhs) |
| divide a 3D vector by a scalar. | |
| a_vector3 | operator/ (a_vector3 const &lhs, a_real rhs) |
| divide a 3D vector by a scalar. | |
| a_vector3 | operator+ (a_vector3 const &rhs) |
| a_vector3 | operator- (a_vector3 const &rhs) |
| negate a 3D vector. | |
instance structure for three-dimensional vector
add a 3D vector to a 3D vector.
compute the angle between two 3D vectors in radians.
compute the cross product (vector product) of two 3D vectors
get the cylindrical coordinates of a 3D vector.
compute the distance between two 3D vectors.
compute the squared distance between two 3D vectors.
divide a 3D vector by a scalar.
compute the dot product (scalar product) of two 3D vectors.
check if two 3D vectors are parallel or anti-parallel.
check if two 3D vectors are orthogonal.
multiplie a 3D vector by a scalar.
|
inline |
negate a 3D vector.
|
inline |
compute the magnitude of a 3D vector.
|
inline |
compute the squared magnitude of a 3D vector.
construct an orthonormal basis from a given 3D direction vector.
compute the outer product (tensor product) of two 3D vectors.
project vector onto the plane perpendicular to normal vector.
project vector onto the direction of vector.
reflect vector across the plane perpendicular to normal vector.
rotate a 3D vector around an arbitrary unit axis using Rodrigues' rotation formula.
rotate a 3D vector around an arbitrary unit axis using Rodrigues' rotation formula.
|
inlinestatic |
rotate a 2D basis in the plane spanned by two orthogonal vectors.
set the cylindrical coordinates of a 3D vector.
set the components of a 3D vector and normalize it in place.
set the spherical coordinates of a 3D vector.
set the cartesian coordinates of a 3D vector.
get the spherical coordinates of a 3D vector.
subtract a 3D vector from a 3D vector.
reflect vector across the line with direction vector.
|
inline |
normalize a 3D vector in-place to unit length.
get the cartesian coordinates of a 3D vector.
multiplie a 3D vector by a scalar.
multiplie a 3D vector by a scalar.
compute the dot product (scalar product) of two 3D vectors.
multiplie a 3D vector by a scalar.
add a 3D vector to a 3D vector.
add a 3D vector to a 3D vector.
subtract a 3D vector from a 3D vector.
negate a 3D vector.
subtract a 3D vector from a 3D vector.
divide a 3D vector by a scalar.
divide a 3D vector by a scalar.
compute the cross product (vector product) of two 3D vectors