Math::Vector<2,T> struct reference
[Core module]


#include <Goptical/Math/Vector>

namespace Goptical {
namespace Math {
template <typename T> struct Vector<2, T>;

This struct is a member of the Math namespace.

This template struct is a specialization of Vector.


This class implements 2d vectors.

The Math namespace contains some commonly used constant vector objects.


See also the full member list section for this struct.



  • Vector()
  • Vector(const VectorBase<2, T> &v)
  • template Vector(const VectorBase<M, T> &v, T p)
  • Vector(T v)
  • Vector(T x, T y)
  • template Vector(const VectorBase<N, T> &v, unsigned int c0, unsigned int c1)
  • bool close_to(const VectorBase<2, T> &m, T error = [...])
  • T cross_product(const Vector<2, T> &v) const
  • T len() const
  • VectorBase<2, T> magnitude(T newlen) const
  • VectorBase<2, T> mul(const VectorBase<2, T> &v) const
  • VectorBase<2, T> & neg()
  • const VectorBase<2, T> & normalize()
  • VectorBase<2, T> normalized() const
  • T operator*(const VectorBase<2, T> &v) const
  • VectorBase<2, T> operator*(T scale) const
  • VectorBase<2, T> operator*(const Matrix<N> &m)
  • const VectorBase<2, T> & operator*=(T scale)
  • VectorBase<2, T> operator+(const VectorBase<2, T> &v) const
  • const VectorBase<2, T> & operator+=(const VectorBase<2, T> &v)
  • VectorBase<2, T> operator-(const VectorBase<2, T> &v) const
  • VectorBase<2, T> operator-() const
  • const VectorBase<2, T> & operator-=(const VectorBase<2, T> &v)
  • VectorBase<2, T> operator/(T scale) const
  • VectorBase<2, T> operator/(const VectorBase<2, T> &v) const
  • const VectorBase<2, T> & operator/=(T scale)
  • bool operator==(const VectorBase<2, T> &m) const
  • T operator[](int n) const
  • T & operator[](int n)
  • template VectorBase<M, T> select(unsigned int bitmask, const VectorBase<M, T> &v) const
  • void set(T value)
  • T & x()
  • T x() const
  • T & y()
  • T y() const

Members detail  


No documentation available

Vector(const VectorBase<2, T> &v)  

No documentation available

template <int M> Vector(const VectorBase<M, T> &v, T p)  

No documentation available

Vector(T v)  

Create a 2d vector with same value for all components

Vector(T x, T y)  

Create a 2d vector from x and y z values

template <int N> Vector(const VectorBase<N, T> &v, unsigned int c0, unsigned int c1)  

Create a 2d vector and initialize from specified components of an other vector

typedef VectorBase<2, T> base  

No documentation available

T cross_product(const Vector<2, T> &v) const  

No documentation available

typedef delegate<void(const Math::Vector2&)> put_delegate_t  

No documentation available

T & x()  

Get reference to vector x value

T x() const  

Get vector x value

T & y()  

Get reference to vector y value

T y() const  

Get vector y value

Valid XHTML 1.0 StrictGenerated by diaxen on Sun Jan 8 00:47:24 2012 using MkDoc