|
|
constexpr | Vector2 (const Vector2< T > &v)=default |
| | Copy constructor.
|
| |
|
constexpr Vector2< T > & | operator= (const Vector2< T > &in)=default |
| |
|
constexpr | Vector2 (const T &x, const T &y) |
| | Explicit constructor, from two components.
|
| |
|
constexpr | Vector2 (const T &t) |
| | Explicit contructor, each component is given value t.
|
| |
|
constexpr const T & | x () const |
| | X component access.
|
| |
|
constexpr const T & | y () const |
| | Y component access.
|
| |
|
constexpr const T & | z () const |
| |
|
constexpr const T & | dof (unsigned u) const |
| | Access to degree of freedom u (0-1).
|
| |
|
T & | rx () |
| | Reference access to x-component.
|
| |
|
T & | ry () |
| | Reference access to y-component.
|
| |
|
T & | rz () |
| |
|
T & | rdof (unsigned u) |
| | Reference accesss to degree-of-freedom u (0-1).
|
| |
|
template<std::size_t N> |
| constexpr decltype(auto) | get () const |
| |
|
template<> |
| constexpr decltype(auto) | get () const |
| |
|
constexpr T | fsum () const |
| | Manhattan norm.
|
| |
|
constexpr T | sum () const |
| | Sum of components.
|
| |
|
constexpr T | mag2 () const |
| | Square of the magnitude, or the dot product with itself.
|
| |
|
constexpr T | mag () const |
| | The magnitude.
|
| |
|
constexpr T | area () const |
| | Size of rectangle represented by x*y - can be negative.
|
| |
|
constexpr T | volume () const |
| | Volume of the rectangle assuming unit depth – same as area(), provided for 2D/3D compile compatibility with Cube.
|
| |
|
constexpr T | spread () const |
| | Assumes vector is being used to store a 1D extent– Returns max-min. (y-x).
|
| |
|
constexpr Vector2< T > | unit () const |
| | Unit vector - be sure vector is nonzero.
|
| |
|
constexpr Vector2< T > | abs () const |
| | Returns vector of absolute values of components.
|
| |
|
constexpr void | fill (const T &d) |
| | Fills all three components with value d.
|
| |
|
constexpr T | maxComp () const |
| | Returns the maximum component.
|
| |
|
constexpr T | minComp () const |
| | Returns the minimum component.
|
| |
|
constexpr unsigned | maxCompIndex () const |
| | Returns the max component index.
|
| |
|
constexpr unsigned | minCompIndex () const |
| | Returns the min component index.
|
| |
| constexpr bool | operator== (const Vector2< T > &v) const |
| | "Safe" division operation - checks for zero and overflow.
|
| |
|
constexpr bool | operator!= (const Vector2< T > &v) const |
| | Comparison operator - no tolerance is used.
|
| |
|
constexpr bool | operator< (const Vector2< T > &v) const |
| | Comparison operator, based on magnitude.
|
| |
|
constexpr bool | operator> (const Vector2< T > &v) const |
| | Comparison operator, based on magnitude.
|
| |
|
constexpr const Vector2< T > & | operator+= (const Vector2< T > &v) |
| | In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
|
| |
| constexpr const Vector2< T > & | operator-= (const Vector2< T > &v) |
| | In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
|
| |
| constexpr const Vector2< T > & | operator*= (const Vector2< T > &v) |
| | In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
|
| |
| constexpr const Vector2< T > & | operator*= (const T &t) |
| | In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
|
| |
| constexpr const Vector2< T > & | operator/= (const Vector2< T > &v) |
| | In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
|
| |
| constexpr const Vector2< T > & | operator/= (const T &t) |
| | In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
|
| |
|
constexpr Vector2< T > | operator+ (const Vector2< T > &v) const |
| | Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
|
| |
| constexpr Vector2< T > | operator- (const Vector2< T > &v) const |
| | Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
|
| |
| constexpr Vector2< T > | operator* (const Vector2< T > &v) const |
| | Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
|
| |
| constexpr Vector2< T > | operator* (const T &t) const |
| | Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
|
| |
| constexpr Vector2< T > | operator/ (const Vector2< T > &v) const |
| | Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
|
| |
| constexpr Vector2< T > | operator/ (const T &t) const |
| | Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
|
| |
|
constexpr T | operator| (const Vector2< T > &v) const |
| | Dot Product.
|
| |
|
constexpr const Vector2< T > & | expandToInclude (const T &t) |
| | Expands 1D range to include value t.
|
| |
|
constexpr const Vector2< T > & | expandToInclude (const Vector2< T > &v) |
| | Expands 1D range to include 1D range v.
|
| |
|
constexpr Vector2< T > | expandedToInclude (const T &t) const |
| | Returns 1D range expanded to include value t;.
|
| |
|
constexpr Vector2< T > | expandedToInclude (const Vector2< T > &v) const |
| | Returns 1D range expanded to include 1D range v.
|
| |
|
constexpr bool | contains (const T &t) const |
| | True if value t falls inside this 1D range (inclusive).
|
| |
|
constexpr Vector2< T > | perp () const |
| |
template<class T>
class Vector2< T >
2D vector utility class.