|
liba 0.1.15
An algorithm library based on C/C++
|
instance structure for two-dimensional vector More...
#include <vector2.h>
Public Member Functions | |
| void | set (a_point2 const &p, a_point2 const &q) |
| set a 2D vector as the difference from point p to point q. | |
| a_real | set_dir (a_real x_, a_real y_) |
| set the components of a 2D vector and normalize it in place. | |
| void | val (a_real &x_, a_real &y_) const |
| get the cartesian coordinates of a 2D vector. | |
| void | set_val (a_real x_, a_real y_) |
| set the cartesian coordinates of a 2D vector. | |
| void | pol (a_real &rho, a_real &theta) const |
| get the polar coordinates of a 2D vector. | |
| void | set_pol (a_real rho, a_real theta) |
| set the polar coordinates of a 2D vector. | |
| void | add (a_vector2 const &rhs, a_vector2 &res) const |
| add a 2D vector to a 2D vector. | |
| void | sub (a_vector2 const &rhs, a_vector2 &res) const |
| subtract a 2D vector from a 2D vector. | |
| void | mul (a_real rhs, a_vector2 &res) const |
| multiplie a 2D vector by a scalar. | |
| void | div (a_real rhs, a_vector2 &res) const |
| divide a 2D vector by a scalar. | |
| void | neg (a_vector2 &res) const |
| negate a 2D vector. | |
| a_real | unit () |
| normalize a 2D vector in-place to unit length. | |
| a_real | norm () const |
| compute the magnitude of a 2D vector. | |
| a_real | norm2 () const |
| compute the squared magnitude of a 2D vector. | |
| a_real | dot (a_vector2 const &rhs) const |
| compute the dot product (scalar product) of two 2D vectors. | |
| a_real | dist (a_vector2 const &rhs) const |
| compute the distance between two 2D vectors. | |
| a_real | dist2 (a_vector2 const &rhs) const |
| compute the squared distance between two 2D vectors. | |
| a_real | angle (a_vector2 const &rhs) const |
| compute the squared distance between two 2D vectors. | |
| a_bool | isver (a_vector2 const &rhs) const |
| check if two 2D vectors are orthogonal. | |
| a_bool | ispar (a_vector2 const &rhs) const |
| check if two 2D vectors are parallel or anti-parallel. | |
| a_real | cross (a_vector2 const &rhs) const |
| compute the cross product (vector product) of two 2D vectors | |
| void | outer (a_vector2 const &rhs, a_real res[4]) const |
| compute the outer product (tensor product) of two 2D vectors. | |
| int | proj (a_vector2 const &dir, a_vector2 &res) const |
| project vector onto the direction of vector. | |
| int | perp (a_vector2 const &dir, a_vector2 &res) const |
| project vector onto the line perpendicular to vector. | |
| int | refl (a_vector2 const &dir, a_vector2 &res) const |
| reflect vector across the line with direction vector. | |
| void | rot (a_real angle, a_vector2 &res) const |
| rotate a 2D vector by a specified angle (in radians). | |
| void | rot (a_real sin, a_real cos, a_vector2 &res) const |
| rotate a 2D vector by a specified angle (in radians). | |
Data Fields | |
| a_real | x |
| a_real | y |
Friends | |
| a_real | operator^ (a_vector2 const &lhs, a_vector2 const &rhs) |
| compute the cross product (vector product) of two 2D vectors | |
| void | operator+= (a_vector2 &lhs, a_vector2 const &rhs) |
| add a 2D vector to a 2D vector. | |
| a_vector2 | operator+ (a_vector2 const &lhs, a_vector2 const &rhs) |
| add a 2D vector to a 2D vector. | |
| void | operator-= (a_vector2 &lhs, a_vector2 const &rhs) |
| subtract a 2D vector from a 2D vector. | |
| a_vector2 | operator- (a_vector2 const &lhs, a_vector2 const &rhs) |
| subtract a 2D vector from a 2D vector. | |
| a_real | operator* (a_vector2 const &lhs, a_vector2 const &rhs) |
| compute the dot product (scalar product) of two 2D vectors. | |
| void | operator*= (a_vector2 &lhs, a_real rhs) |
| multiplie a 2D vector by a scalar. | |
| a_vector2 | operator* (a_real lhs, a_vector2 const &rhs) |
| multiplie a 2D vector by a scalar. | |
| a_vector2 | operator* (a_vector2 const &lhs, a_real rhs) |
| multiplie a 2D vector by a scalar. | |
| void | operator/= (a_vector2 &lhs, a_real rhs) |
| divide a 2D vector by a scalar. | |
| a_vector2 | operator/ (a_vector2 const &lhs, a_real rhs) |
| divide a 2D vector by a scalar. | |
| a_vector2 | operator+ (a_vector2 const &rhs) |
| a_vector2 | operator- (a_vector2 const &rhs) |
| negate a 2D vector. | |
instance structure for two-dimensional vector
add a 2D vector to a 2D vector.
compute the squared distance between two 2D vectors.
compute the cross product (vector product) of two 2D vectors
compute the distance between two 2D vectors.
compute the squared distance between two 2D vectors.
divide a 2D vector by a scalar.
compute the dot product (scalar product) of two 2D vectors.
check if two 2D vectors are parallel or anti-parallel.
check if two 2D vectors are orthogonal.
multiplie a 2D vector by a scalar.
|
inline |
negate a 2D vector.
|
inline |
compute the magnitude of a 2D vector.
|
inline |
compute the squared magnitude of a 2D vector.
compute the outer product (tensor product) of two 2D vectors.
project vector onto the line perpendicular to vector.
get the polar coordinates of a 2D vector.
project vector onto the direction of vector.
reflect vector across the line with direction vector.
rotate a 2D vector by a specified angle (in radians).
rotate a 2D vector by a specified angle (in radians).
set the components of a 2D vector and normalize it in place.
set the polar coordinates of a 2D vector.
set the cartesian coordinates of a 2D vector.
subtract a 2D vector from a 2D vector.
|
inline |
normalize a 2D vector in-place to unit length.
get the cartesian coordinates of a 2D vector.
multiplie a 2D vector by a scalar.
multiplie a 2D vector by a scalar.
compute the dot product (scalar product) of two 2D vectors.
multiplie a 2D vector by a scalar.
add a 2D vector to a 2D vector.
add a 2D vector to a 2D vector.
subtract a 2D vector from a 2D vector.
negate a 2D vector.
subtract a 2D vector from a 2D vector.
divide a 2D vector by a scalar.
divide a 2D vector by a scalar.
compute the cross product (vector product) of two 2D vectors