#include <Vector2DBase.h>
Public Types | |
typedef PV2DBase< T, VectorTag, FrameTag > | BaseClass |
typedef Basic2DVector< T > | BasicVectorType |
typedef BaseClass::Polar | Polar |
Public Member Functions | |
template<class U > | |
PreciseFloatType< T, U >::Type | dot (const Vector2DBase< U, FrameTag > &v) const |
Vector2DBase & | operator*= (const T &t) |
Scaling by a scalar value (multiplication) | |
template<class U > | |
Vector2DBase & | operator+= (const Vector2DBase< U, FrameTag > &v) |
Vector2DBase | operator- () const |
Unary minus, returns a vector with components (-x(),-y()) | |
template<class U > | |
Vector2DBase & | operator-= (const Vector2DBase< U, FrameTag > &v) |
Vector2DBase & | operator/= (const T &t) |
Scaling by a scalar value (division) | |
Vector2DBase | unit () const |
Vector2DBase (const T &x, const T &y) | |
construct from cartesian coordinates | |
template<class U > | |
Vector2DBase (const Vector2DBase< U, FrameTag > &p) | |
template<class U > | |
Vector2DBase (const Basic2DVector< U > &v) | |
Vector2DBase () | |
Vector2DBase (const Polar &set) | |
construct from polar coordinates |
Definition at line 9 of file Vector2DBase.h.
typedef PV2DBase<T, VectorTag, FrameTag> Vector2DBase< T, FrameTag >::BaseClass |
Definition at line 12 of file Vector2DBase.h.
typedef Basic2DVector<T> Vector2DBase< T, FrameTag >::BasicVectorType |
Reimplemented from PV2DBase< T, VectorTag, FrameTag >.
Definition at line 13 of file Vector2DBase.h.
typedef BaseClass::Polar Vector2DBase< T, FrameTag >::Polar |
Reimplemented from PV2DBase< T, VectorTag, FrameTag >.
Definition at line 14 of file Vector2DBase.h.
Vector2DBase< T, FrameTag >::Vector2DBase | ( | ) | [inline] |
default constructor uses default constructor of T to initialize the components. For built-in floating-point types this means initialization to zero
Definition at line 20 of file Vector2DBase.h.
Referenced by Vector2DBase< float, GlobalTag >::operator-(), and Vector2DBase< float, GlobalTag >::unit().
{}
Vector2DBase< T, FrameTag >::Vector2DBase | ( | const Vector2DBase< U, FrameTag > & | p | ) | [inline] |
Construct from another vector in the same reference frame, possiblly with different precision
Definition at line 26 of file Vector2DBase.h.
: BaseClass( p.basicVector()) {}
Vector2DBase< T, FrameTag >::Vector2DBase | ( | const T & | x, |
const T & | y | ||
) | [inline] |
construct from cartesian coordinates
Definition at line 29 of file Vector2DBase.h.
Vector2DBase< T, FrameTag >::Vector2DBase | ( | const Polar & | set | ) | [inline, explicit] |
Vector2DBase< T, FrameTag >::Vector2DBase | ( | const Basic2DVector< U > & | v | ) | [inline, explicit] |
Explicit constructor from BasicVectorType, bypasses consistency checks for point/vector and for coordinate frame. To be used as carefully as e.g. const_cast.
Definition at line 39 of file Vector2DBase.h.
: BaseClass(v) {}
PreciseFloatType<T,U>::Type Vector2DBase< T, FrameTag >::dot | ( | const Vector2DBase< U, FrameTag > & | v | ) | const [inline] |
Scalar (or dot) product with a vector of possibly different precision, defined in the same reference frame. The product is computed without loss of precision. The type of the returned scalar is the more precise of the scalar types of the two vectors.
Definition at line 87 of file Vector2DBase.h.
{ return this->basicVector().dot( v.basicVector()); }
Vector2DBase& Vector2DBase< T, FrameTag >::operator*= | ( | const T & | t | ) | [inline] |
Scaling by a scalar value (multiplication)
Definition at line 68 of file Vector2DBase.h.
{ this->basicVector() *= t; return *this; }
Vector2DBase& Vector2DBase< T, FrameTag >::operator+= | ( | const Vector2DBase< U, FrameTag > & | v | ) | [inline] |
Increment by another Vector of possibly different precision, defined in the same reference frame
Definition at line 50 of file Vector2DBase.h.
{ this->basicVector() += v.basicVector(); return *this; }
Vector2DBase Vector2DBase< T, FrameTag >::operator- | ( | ) | const [inline] |
Unary minus, returns a vector with components (-x(),-y())
Definition at line 65 of file Vector2DBase.h.
{ return Vector2DBase(-this->basicVector());}
Vector2DBase& Vector2DBase< T, FrameTag >::operator-= | ( | const Vector2DBase< U, FrameTag > & | v | ) | [inline] |
Decrement by another Vector of possibly different precision, defined in the same reference frame
Definition at line 59 of file Vector2DBase.h.
{ this->basicVector() -= v.basicVector(); return *this; }
Vector2DBase& Vector2DBase< T, FrameTag >::operator/= | ( | const T & | t | ) | [inline] |
Scaling by a scalar value (division)
Definition at line 74 of file Vector2DBase.h.
{ this->basicVector() /= t; return *this; }
Vector2DBase Vector2DBase< T, FrameTag >::unit | ( | ) | const [inline] |
Unit vector parallel to this. If mag() is zero, a zero vector is returned.
Definition at line 44 of file Vector2DBase.h.
Referenced by Vector2DBase< float, GlobalTag >::unit().
{ return Vector2DBase( this->basicVector().unit());}