|
Itasca C++ Interface
|
2D vector utility class. More...
#include <vect.h>
Public Member Functions | |
| Vector2 () | |
| Default constructor, no data initialization. | |
| Vector2 (const Vector2< T > &v) | |
| Copy constructor. | |
| Vector2 (const T &x, const T &y) | |
| Explicit constructor, from two components. | |
| Vector2 (const T &t) | |
| Explicit contructor, each component is given value t. | |
| const T & | x () const |
| X component access. | |
| const T & | y () const |
| Y component access. | |
| 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 & | rdof (unsigned u) |
| Reference accesss to degree-of-freedom u (0-1). | |
| const T & | operator[] (unsigned u) const |
| Allow array like access by degree of freedom (0-1) | |
| T & | operator[] (unsigned u) |
| template<std::size_t N> | |
| decltype(auto) | get () const |
| T | fsum () const |
| Manhattan norm. | |
| T | sum () const |
| Sum of components. | |
| T | mag2 () const |
| Square of the magnitude, or the dot product with itself. | |
| T | mag () const |
| The magnitude. | |
| T | area () const |
| Size of rectangle represented by x*y - can be negative. | |
| T | volume () const |
| Volume of the rectangle assuming unit depth – same as area(), provided for 2D/3D compile compatibility with Cube. | |
| T | spread () const |
| Assumes vector is being used to store a 1D extent– Returns max-min. (y-x). | |
| Vector2< T > | unit () const |
| Unit vector - be sure vector is nonzero. | |
| Vector2< T > | abs () const |
| Returns vector of absolute values of components. | |
| void | fill (const T &d) |
| Fills all three components with value d. | |
| T | maxComp () const |
| Returns the maximum component. | |
| T | minComp () const |
| Returns the minimum component. | |
| unsigned | maxCompIndex () const |
| Returns the max component index. | |
| unsigned | minCompIndex () const |
| Returns the min component index. | |
| const Vector2< T > & | safeDivE (const Vector2< T > &v) |
| "Safe" division operation - checks for zero and overflow. | |
| const Vector2< T > | safeDiv (const Vector2< T > &v) |
| "Safe" division operation - checks for zero and overflow. | |
| bool | operator== (const Vector2< T > &v) const |
| Comparison operator - no tolerance is used. | |
| bool | operator!= (const Vector2< T > &v) const |
| Comparison operator - no tolerance is used. | |
| bool | operator< (const Vector2< T > &v) const |
| Comparison operator, based on magnitude. | |
| bool | operator> (const Vector2< T > &v) const |
| Comparison operator, based on magnitude. | |
| 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. | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| T | operator| (const Vector2< T > &v) const |
| Dot Product. | |
| const Vector2< T > & | expandToInclude (const T &t) |
| Expands 1D range to include value t. | |
| const Vector2< T > & | expandToInclude (const Vector2< T > &v) |
| Expands 1D range to include 1D range v. | |
| Vector2< T > | expandedToInclude (const T &t) const |
| Returns 1D range expanded to include value t;. | |
| Vector2< T > | expandedToInclude (const Vector2< T > &v) const |
| Returns 1D range expanded to include 1D range v. | |
| bool | contains (const T &t) const |
| True if value t falls inside this 1D range (inclusive). | |
Static Public Member Functions | |
| static Vector2< T > | nothing () |
| Creates an "empty" vector, useful when Vector2 is used as a 1D extent. | |
Related Functions | |
(Note that these are not member functions.) | |
| typedef Vector2< Double > | DVect2 |
| typedef Vector2< Float > | FVect2 |
| typedef Vector2< Int > | IVect2 |
| typedef Vector2< UInt > | UVect2 |
| typedef Vector2< Long > | LVect2 |
| typedef Vector2< ULong > | ULVect2 |
| template<class T > | |
| DVect2 | toDVect2 (const Vector2< T > &v) |
| template<class T > | |
| FVect2 | toFVect2 (const Vector2< T > &v) |
| template<class T > | |
| IVect2 | toIVect2 (const Vector2< T > &v) |
| template<class T > | |
| UVect2 | toUVect2 (const Vector2< T > &v) |
| template<class T > | |
| Vector2< T > | vmax (const Vector2< T > &v1, const Vector2< T > &v2) |
| template<class T > | |
| Vector2< T > | vmin (const Vector2< T > &v1, const Vector2< T > &v2) |
| template<class T > | |
| Vector2< T > | vsign (const Vector2< T > &v1, const Vector2< T > &v2) |
| template<class T > | |
| Vector2< T > | vceil (const Vector2< T > &v) |
| template<class T > | |
| Vector2< T > | vfloor (const Vector2< T > &v) |
| template<class T > | |
| IVect2 | vround (const Vector2< T > &v) |
2D vector utility class.
Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done on a component basis.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
1.8.15