iaux::iaVector2< T > Struct Template Reference

#include <iaVector2.h>

Public Member Functions

 iaVector2 ()=default
 
 iaVector2 (T x, T y)
 
iaVector2< T > operator+ (const iaVector2< T > &vec) const
 
void operator+= (const iaVector2< T > &vec)
 
iaVector2< T > operator- (const iaVector2< T > &vec) const
 
void operator-= (const iaVector2< T > &vec)
 
iaVector2< T > operator= (const iaVector2< T > &vec)
 
iaVector2< T > operator* (T scalar) const
 
void operator*= (T scalar)
 
iaVector2< T > operator/ (T scalar) const
 
void operator/= (T scalar)
 
bool operator== (const iaVector2< T > &vec) const
 
bool operator!= (const iaVector2< T > &vec) const
 
operator* (const iaVector2< T > &vec) const
 
const T & operator[] (int index) const
 
T & operator[] (int index)
 
T * getData ()
 
const T * getData () const
 
void set (T x, T y)
 
length () const
 
length2 () const
 
distance (const iaVector2< T > &vec) const
 
distance2 (const iaVector2< T > &vec) const
 
angle () const
 
angle (iaVector2< T > &vec) const
 
void rotateXY (T angle)
 
void normalize ()
 
void negate ()
 
template<class T2 >
iaVector2< T2 > convert () const
 
template<class T2 >
IGOR_INLINE iaVector2< T2 > convert () const
 

Public Attributes

_x = static_cast<T>(0)
 
_y = static_cast<T>(0)
 

Detailed Description

template<typename T>
struct iaux::iaVector2< T >

2 dimensional vector

Constructor & Destructor Documentation

◆ iaVector2() [1/2]

template<typename T >
iaux::iaVector2< T >::iaVector2 ( )
default

does nothing

◆ iaVector2() [2/2]

template<typename T >
IGOR_INLINE iaVector2::iaVector2 ( x,
y 
)

initializes the vector with x y components

Parameters
xx component
yy component

Member Function Documentation

◆ angle() [1/2]

template<typename T >
IGOR_INLINE T iaVector2::angle ( ) const
Returns
angle in rad
-PI/2
  |
PI ----— 0.0 | PI/2

◆ angle() [2/2]

template<typename T >
IGOR_INLINE T iaVector2::angle ( iaVector2< T > &  vec) const
Returns
angle in rad between two vectors
Parameters
vecsecond vector to calculate the angle with

◆ convert() [1/2]

template<typename T >
template<class T2 >
iaVector2< T2 > iaux::iaVector2< T >::convert ( ) const

converts the vector in to given type of vector

Returns
vector for given type

◆ convert() [2/2]

template<typename T >
template<class T2 >
IGOR_INLINE iaVector2< T2 > iaux::iaVector2< T >::convert ( ) const

◆ distance()

template<typename T >
IGOR_INLINE T iaVector2::distance ( const iaVector2< T > &  vec) const
Returns
distance between positions
Parameters
vecthe second position to calculate the distance to

◆ distance2()

template<typename T >
IGOR_INLINE T iaVector2::distance2 ( const iaVector2< T > &  vec) const
Returns
quadratic distance between positions
Parameters
vecthe second position to calculate the distance to

◆ getData() [1/2]

template<typename T >
IGOR_INLINE T * iaVector2::getData ( )
Returns
pointer to data

◆ getData() [2/2]

template<typename T >
IGOR_INLINE const T * iaVector2::getData ( ) const
Returns
pointer to data (const version)

◆ length()

template<typename T >
IGOR_INLINE T iaVector2::length ( ) const
Returns
length of vector

◆ length2()

template<typename T >
IGOR_INLINE T iaVector2::length2 ( ) const
Returns
quadratic length of vector

◆ negate()

template<typename T >
IGOR_INLINE void iaVector2::negate ( )

conjugates (or negates) the vector

◆ normalize()

template<typename T >
IGOR_INLINE void iaVector2::normalize ( )

normalizes the vector

◆ operator!=()

template<typename T >
IGOR_INLINE bool iaVector2::operator!= ( const iaVector2< T > &  vec) const

comparison of two vectors

no deviation accepted

Returns
true: if not equal; false: if excactly equal

◆ operator*() [1/2]

template<typename T >
IGOR_INLINE T iaVector2::operator* ( const iaVector2< T > &  vec) const

dot product between two vectors

Parameters
vecvector to multiply this vector with
Returns
dot product of both vectors

◆ operator*() [2/2]

template<typename T >
IGOR_INLINE iaVector2< T > iaVector2::operator* ( scalar) const

multiplication of vector with scalar

Parameters
scalarvalue to multiply with this vector
Returns
resulting vector

◆ operator*=()

template<typename T >
IGOR_INLINE void iaVector2::operator*= ( scalar)

multiplication of vector with scalar and assignment

Parameters
scalarvalue to multiply with this vector

◆ operator+()

template<typename T >
IGOR_INLINE iaVector2< T > iaVector2::operator+ ( const iaVector2< T > &  vec) const

vector addition

Parameters
vecvector to be added to this vector
Returns
resulting vector

◆ operator+=()

template<typename T >
IGOR_INLINE void iaVector2::operator+= ( const iaVector2< T > &  vec)

vector addition and assignment

Parameters
vecvector to be added to this vector

◆ operator-()

template<typename T >
IGOR_INLINE iaVector2< T > iaVector2::operator- ( const iaVector2< T > &  vec) const

vector subtraction

Parameters
vecvector to be subtracted from this vector
Returns
resulting vector

◆ operator-=()

template<typename T >
IGOR_INLINE void iaVector2::operator-= ( const iaVector2< T > &  vec)

vector subtraction and assignment

Parameters
vecvector to be subtracted from this vector

◆ operator/()

template<typename T >
IGOR_INLINE iaVector2< T > iaVector2::operator/ ( scalar) const

division of vector with scalar

Parameters
scalarvalue to devide this vector by
Returns
resulting vector

◆ operator/=()

template<typename T >
IGOR_INLINE void iaVector2::operator/= ( scalar)

division of vector with scalar and assignment

Parameters
scalarvalue to devide this vector by

◆ operator=()

template<typename T >
IGOR_INLINE iaVector2< T > iaVector2::operator= ( const iaVector2< T > &  vec)

vector assignment

Parameters
vecvector to be assigned to this vector

◆ operator==()

template<typename T >
IGOR_INLINE bool iaVector2::operator== ( const iaVector2< T > &  vec) const

comparison of two vectors

no deviation accepted

Returns
true: if excactly equal; false: if not equal

◆ operator[]() [1/2]

template<typename T >
IGOR_INLINE T & iaVector2::operator[] ( int  index)
Returns
value by index
Parameters
indexthe index of the value to be returned

◆ operator[]() [2/2]

template<typename T >
IGOR_INLINE const T & iaVector2::operator[] ( int  index) const
Returns
value by index (const version)
Parameters
indexthe index of the value to be returned

◆ rotateXY()

template<typename T >
IGOR_INLINE void iaVector2::rotateXY ( angle)

rotates a vector in XY plane

Parameters
anglethe angle in rad to rotate the vector with

◆ set()

template<typename T >
IGOR_INLINE void iaVector2::set ( x,
y 
)

set values

Parameters
xx value to set
yy value to set

Member Data Documentation

◆ _x

template<typename T >
T iaux::iaVector2< T >::_x = static_cast<T>(0)

x component

◆ _y

template<typename T >
T iaux::iaVector2< T >::_y = static_cast<T>(0)

y component


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