|
Enki
1.9
|
A vector in a 2D space. More...
#include <Geometry.h>
Public Member Functions | |
| Vector () | |
| Constructor, create vector with coordinates (0, 0) | |
| Vector (double v) | |
| Constructor, create vector with coordinates (v, v) | |
| Vector (double x, double y) | |
| Constructor, create vector with coordinates (x, y) | |
| Vector (double array[2]) | |
| Constructor, create vector with coordinates (array[0], array[1]) | |
| void | operator+= (const Vector &v) |
| Add vector v component by component. | |
| void | operator-= (const Vector &v) |
| Substract vector v component by component. | |
| void | operator*= (double f) |
| Multiply each component by scalar f. | |
| void | operator/= (double f) |
| Divive each component by scalar f. | |
| Vector | operator+ (const Vector &v) const |
| Add vector v component by component and return the resulting vector. | |
| Vector | operator- (const Vector &v) const |
| Substract vector v component by component and return the resulting vector. | |
| Vector | operator/ (double f) const |
| Multiply each component by scalar f and return the resulting vector. | |
| Vector | operator* (double f) const |
| Divive each component by scalar f and return the resulting vector. | |
| Vector | operator- () const |
| Invert this vector. | |
| double | operator* (const Vector &v) const |
| Return the scalar product with vector v. | |
| double | norm (void) const |
| Return the norm of this vector. | |
| double | norm2 (void) const |
| Return the square norm of this vector (and thus avoid a square root) | |
| double | cross (const Vector &v) const |
| Return the cross product with vector v. | |
| Vector | unitary (void) const |
| Return a unitary vector of same direction. | |
| double | angle (void) const |
| Return the angle with the horizontal (arc tangant (y/x)) | |
| Vector | perp (void) const |
| Return the perpendicular of the same norm in math. orientation (CCW) | |
| Vector | crossWithZVector (double l) const |
| Return the cross with (this x other) a (virtual, as we are in 2D) perpendicular vector (on axis z) of given norm. | |
| Vector | crossFromZVector (double l) const |
| Return the cross from (other x this) a (virtual, as we are in 2D) perpendicular vector (on axis z) of given norm. | |
| bool | operator< (const Vector &that) const |
| Comparison operator. | |
Public Attributes | |
| double | x |
| x component | |
| double | y |
| y component | |
1.8.11