# Cinder

# cinder::Vec2< T > Class Template Reference

`#include <Vector.h>`

List of all members.

## Public Types
typedef T | TYPE
## Public Member Functions
| Vec2 ()
| Vec2 (T nx, T ny)
| Vec2 (const Vec2< T > &src)
| Vec2 (const T *d)
template<typename FromT >
| Vec2 (const Vec2< FromT > &src)
void | set (T ax, T ay)
void | set (const Vec2< T > &rhs)
template<typename FromT >
Vec2< T > & | operator= (const Vec2< FromT > &rhs)
Vec2< T > & | operator= (const Vec2< T > &rhs)
T & | operator[] (int n)
const T & | operator[] (int n) const
const Vec2< T > | operator+ (const Vec2< T > &rhs) const
const Vec2< T > | operator- (const Vec2< T > &rhs) const
const Vec2< T > | operator* (const Vec2< T > &rhs) const
const Vec2< T > | operator/ (const Vec2< T > &rhs) const
Vec2< T > & | operator+= (const Vec2< T > &rhs)
Vec2< T > & | operator-= (const Vec2< T > &rhs)
Vec2< T > & | operator*= (const Vec2< T > &rhs)
Vec2< T > & | operator/= (const Vec2< T > &rhs)
const Vec2< T > | operator/ (T rhs) const
Vec2< T > & | operator+= (T rhs)
Vec2< T > & | operator-= (T rhs)
Vec2< T > & | operator*= (T rhs)
Vec2< T > & | operator/= (T rhs)
Vec2< T > | operator- () const
bool | operator== (const Vec2< T > &rhs) const
bool | operator!= (const Vec2< T > &rhs) const
T | dot (const Vec2< T > &rhs) const
T | distance (const Vec2< T > &rhs) const
T | distanceSquared (const Vec2< T > &rhs) const
T | length () const
void | normalize ()
Vec2< T > | normalized () const
void | safeNormalize ()
Vec2< T > | safeNormalized ()
T | lengthSquared () const
void | invert ()
Vec2< T > | inverse ()
Vec2< T > | lerp (T fact, const Vec2< T > &r) const
| operator T * ()
| operator const T * () const
## Static Public Member Functions
static Vec2< T > | max ()
static Vec2< T > | zero ()
static Vec2< T > | one ()
static Vec2< T > | xAxis ()
static Vec2< T > | yAxis ()
## Public Attributes
T | x
T | y
## Static Public Attributes
static const int | DIM = 2
## Friends
std::ostream & | operator<< (std::ostream &lhs, const Vec2< T > &rhs)

### template<typename T>
class cinder::Vec2< T >

## Member Typedef Documentation

template<typename T>

typedef T cinder::Vec2< T >::TYPE

## Constructor & Destructor Documentation

template<typename T>

cinder::Vec2< T >::Vec2 | ( |  | ) |

template<typename T>

cinder::Vec2< T >::Vec2 | ( | T | nx,
|  | T | ny |
| ) |  |  |

template<typename T>

cinder::Vec2< T >::Vec2 | ( | const Vec2< T > & | src | ) |

template<typename T>

cinder::Vec2< T >::Vec2 | ( | const T * | d | ) | `[explicit]`

template<typename T>
template<typename FromT >

cinder::Vec2< T >::Vec2 | ( | const Vec2< FromT > & | src | ) |

## Member Function Documentation

template<typename T>

void cinder::Vec2< T >::set | ( | T | ax,
|  | T | ay |
| ) |  |  |

template<typename T>

void cinder::Vec2< T >::set | ( | const Vec2< T > & | rhs | ) |

template<typename T>
template<typename FromT >

Vec2<T>& cinder::Vec2< T >::operator= | ( | const Vec2< FromT > & | rhs | ) |

template<typename T>

Vec2<T>& cinder::Vec2< T >::operator= | ( | const Vec2< T > & | rhs | ) |

template<typename T>

T& cinder::Vec2< T >::operator[] | ( | int | n | ) |

template<typename T>

const T& cinder::Vec2< T >::operator[] | ( | int | n | ) | const

template<typename T>

const Vec2<T> cinder::Vec2< T >::operator+ | ( | const Vec2< T > & | rhs | ) | const

template<typename T>

const Vec2<T> cinder::Vec2< T >::operator- | ( | const Vec2< T > & | rhs | ) | const

template<typename T>

const Vec2<T> cinder::Vec2< T >::operator* | ( | const Vec2< T > & | rhs | ) | const

template<typename T>

const Vec2<T> cinder::Vec2< T >::operator/ | ( | const Vec2< T > & | rhs | ) | const

template<typename T>

Vec2<T>& cinder::Vec2< T >::operator+= | ( | const Vec2< T > & | rhs | ) |

template<typename T>

Vec2<T>& cinder::Vec2< T >::operator-= | ( | const Vec2< T > & | rhs | ) |

template<typename T>

Vec2<T>& cinder::Vec2< T >::operator*= | ( | const Vec2< T > & | rhs | ) |

template<typename T>

Vec2<T>& cinder::Vec2< T >::operator/= | ( | const Vec2< T > & | rhs | ) |

template<typename T>

const Vec2<T> cinder::Vec2< T >::operator/ | ( | T | rhs | ) | const

template<typename T>

Vec2<T>& cinder::Vec2< T >::operator+= | ( | T | rhs | ) |

template<typename T>

Vec2<T>& cinder::Vec2< T >::operator-= | ( | T | rhs | ) |

template<typename T>

Vec2<T>& cinder::Vec2< T >::operator*= | ( | T | rhs | ) |

template<typename T>

Vec2<T>& cinder::Vec2< T >::operator/= | ( | T | rhs | ) |

template<typename T>

Vec2<T> cinder::Vec2< T >::operator- | ( |  | ) | const

template<typename T>

bool cinder::Vec2< T >::operator== | ( | const Vec2< T > & | rhs | ) | const

template<typename T>

bool cinder::Vec2< T >::operator!= | ( | const Vec2< T > & | rhs | ) | const

template<typename T>

T cinder::Vec2< T >::dot | ( | const Vec2< T > & | rhs | ) | const

template<typename T>

T cinder::Vec2< T >::distance | ( | const Vec2< T > & | rhs | ) | const

template<typename T>

T cinder::Vec2< T >::distanceSquared | ( | const Vec2< T > & | rhs | ) | const

template<typename T>

T cinder::Vec2< T >::length | ( |  | ) | const

template<typename T>

void cinder::Vec2< T >::normalize | ( |  | ) |

template<typename T>

Vec2<T> cinder::Vec2< T >::normalized | ( |  | ) | const

template<typename T>

void cinder::Vec2< T >::safeNormalize | ( |  | ) |

template<typename T>

Vec2<T> cinder::Vec2< T >::safeNormalized | ( |  | ) |

template<typename T>

T cinder::Vec2< T >::lengthSquared | ( |  | ) | const

template<typename T>

void cinder::Vec2< T >::invert | ( |  | ) |

template<typename T>

Vec2<T> cinder::Vec2< T >::inverse | ( |  | ) |

template<typename T>

Vec2<T> cinder::Vec2< T >::lerp | ( | T | fact,
|  | const Vec2< T > & | r |
| ) |  |  | const

template<typename T>

static Vec2<T> cinder::Vec2< T >::max | ( |  | ) | `[static]`

template<typename T>

static Vec2<T> cinder::Vec2< T >::zero | ( |  | ) | `[static]`

template<typename T>

static Vec2<T> cinder::Vec2< T >::one | ( |  | ) | `[static]`

template<typename T>

cinder::Vec2< T >::operator T * | ( |  | ) |

template<typename T>

cinder::Vec2< T >::operator const T * | ( |  | ) | const

template<typename T>

static Vec2<T> cinder::Vec2< T >::xAxis | ( |  | ) | `[static]`

template<typename T>

static Vec2<T> cinder::Vec2< T >::yAxis | ( |  | ) | `[static]`

## Friends And Related Function Documentation

template<typename T>

std::ostream& operator<< | ( | std::ostream & | lhs,
|  | const Vec2< T > & | rhs |
| ) |  |  | `[friend]`

## Member Data Documentation

template<typename T>

T cinder::Vec2< T >::x

template<typename T>

T cinder::Vec2< T >::y

template<typename T>

const int cinder::Vec2< T >::DIM = 2`[static]`

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

- include/cinder/Vector.h