Claw
1.7.3
|
Two dimensional vector. More...
#include <vector_2d.hpp>
Public Types | |
typedef T | value_type |
The type of the values we store. | |
typedef vector_2d< value_type > | self_type |
The type of the current class. | |
typedef coordinate_2d< value_type > | super |
The type of the parent class. | |
Public Types inherited from claw::math::coordinate_2d< T > | |
typedef T | value_type |
The type of the values we store. | |
typedef coordinate_2d< value_type > | self_type |
The type of the current class. |
Public Member Functions | |
vector_2d () | |
Constructor. | |
template<class U > | |
vector_2d (const coordinate_2d< U > &that) | |
Copy constructor. | |
template<class U > | |
vector_2d (const coordinate_2d< U > &p1, const coordinate_2d< U > &p2) | |
Construct a vector from two points. | |
vector_2d (const value_type &_x, const value_type &_y) | |
Constructor with initialization. | |
value_type | length () const |
Gets vector length. | |
void | normalize () |
Normalize the vector. | |
self_type | get_orthonormal_clockwise () const |
Get a vector orthonormal to this vector. | |
self_type | get_orthonormal_anticlockwise () const |
Get a vector orthonormal to this vector. | |
value_type | dot_product (const self_type &vect) const |
Dot product. | |
Public Member Functions inherited from claw::math::coordinate_2d< T > | |
coordinate_2d () | |
Constructor. | |
template<typename U > | |
coordinate_2d (const coordinate_2d< U > &that) | |
Copy constructor. | |
coordinate_2d (const value_type &_x, const value_type &_y) | |
Constructor with initialization. | |
template<typename U > | |
coordinate_2d< U > | cast_value_type_to () const |
Get a copy of the rectangle by converting its members to a given type. | |
void | set (const value_type &_x, const value_type &_y) |
Sets new values to the coordinate. | |
value_type | distance (const self_type &p) const |
Get the distance separing two coordinates. | |
void | rotate (const self_type ¢er, double angle) |
Rotate this point around an other point. | |
double | slope_angle (const self_type &to) const |
Get the angle of the slope starting from this and ending with an other coordinate. | |
bool | operator== (const self_type &vect) const |
Equality operator. | |
bool | operator!= (const self_type &vect) const |
Difference operator. | |
self_type | operator+ (const self_type &vect) const |
Addition. | |
self_type | operator- (const self_type &vect) const |
Subtraction. | |
self_type & | operator+= (const self_type &vect) |
Add a coordinate. | |
self_type & | operator-= (const self_type &vect) |
Subtract a coordinate. | |
self_type | operator* (const value_type &v) const |
Multiplication. | |
self_type | operator/ (const value_type &v) const |
Division. | |
self_type & | operator*= (const value_type &v) |
Multiply the coordinates. | |
self_type & | operator/= (const value_type &v) |
Divide the coordinates. |
Additional Inherited Members | |
Public Attributes inherited from claw::math::coordinate_2d< T > | |
value_type | x |
X-coordinate. | |
value_type | y |
Y-coordinate. |
Two dimensional vector.
Definition at line 44 of file vector_2d.hpp.
claw::math::vector_2d< T >::vector_2d | ( | const value_type & | _x, |
const value_type & | _y | ||
) |
Constructor with initialization.
_x | x value. |
_y | y Value. |
Definition at line 74 of file vector_2d.tpp.
claw::math::vector_2d< T >::value_type claw::math::vector_2d< T >::dot_product | ( | const self_type & | that | ) | const |
Dot product.
that | The other operand. |
Definition at line 136 of file vector_2d.tpp.
References claw::math::coordinate_2d< T >::x, and claw::math::coordinate_2d< T >::y.