Claw  1.7.3
Public Types | Public Member Functions
claw::math::vector_2d< T > Class Template Reference

Two dimensional vector. More...

#include <vector_2d.hpp>

Inheritance diagram for claw::math::vector_2d< T >:
claw::math::coordinate_2d< T >

List of all members.

Public Types

typedef T value_type
 The type of the values we store.
typedef vector_2d< value_typeself_type
 The type of the current class.
typedef coordinate_2d< value_typesuper
 The type of the parent 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.

Detailed Description

template<class T>
class claw::math::vector_2d< T >

Two dimensional vector.

Author:
Julien Jorge

Definition at line 44 of file vector_2d.hpp.


Constructor & Destructor Documentation

template<class T >
claw::math::vector_2d< T >::vector_2d ( const value_type _x,
const value_type _y 
)

Constructor with initialization.

Parameters:
_xx value.
_yy Value.

Definition at line 74 of file vector_2d.tpp.


Member Function Documentation

template<class T >
claw::math::vector_2d< T >::value_type claw::math::vector_2d< T >::dot_product ( const self_type that) const

Dot product.

Parameters:
thatThe 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.


The documentation for this class was generated from the following files: