Itasca C++ Interface
|
2D Angular vector class. More...
#include <avect.h>
Public Member Functions | |
PUSHWARNING | AVector2 () |
Default constructor, no data initialization. | |
POPWARNING | AVector2 (const AVector2 &av) |
Copy constructor. | |
AVector2 (const T &t) | |
Explicit conversion constructor, the z component is initialized to t. | |
AVector2 (const Vector2< T > &) | |
Explicit conversion constructor, the z component is set to 0, the x and y values of v are lost. | |
AVector2 (const Vector3< T > &v) | |
Explicit convertion contructor, the z component or v is copied but he x and y values are lost. | |
constexpr const AVector2< T > & | operator= (const AVector2< T > &v) |
const T & | x () const |
Member access - the x and y values are always uniquely 0 for a 2D angular vector. | |
const T & | y () const |
Member access - the x and y values are always uniquely 0 for a 2D angular vector. | |
const T & | z () const |
Member access - returns the z component of the 2D angular vector. | |
const T & | dof (uint32 u) const |
General degree-of-freedom access. If u is 2 returns the z component, otherwise returns 0.0. | |
T & | rz () |
Returns a reference to the z component, cannot reference access x or y. | |
T & | rdof (uint32 u) |
Returns a reference to the z component if u=2, any other value of u is an error. | |
const T & | operator[] (uint32 u) const |
General degree-of-freedom access. If u is 2 returns the z component, otherwise returns 0.0. | |
T & | operator[] (uint32 u) |
Returns a reference to the z component if u=2, any other value of u is an error. | |
T | fsum () const |
The Manhatten norm. | |
T | mag2 () const |
The square of the magnitude, or the vector dotted with itself. | |
T | mag () const |
The magnitude of the vector. | |
T | area () const |
Area represented by x*y, always returns 0.0. | |
T | volume () const |
Volume represented by x*y*z, always returns 0.0. | |
AVector2< T > | unit () const |
returns a unit vector. | |
AVector2< T > | abs () const |
Returns a vector of absolute values of components. | |
void | fill (const T &d) |
Fill all components with d. | |
T | maxComp () const |
Returns the maximum component (assuming x and y are 0.0) | |
T | minComp () const |
Returns the minimum component (assuming x and y are 0.0) | |
bool | operator== (const AVector2< T > &av) const |
comparison operator | |
bool | operator!= (const AVector2< T > &av) const |
comparison operator | |
bool | operator< (const AVector2< T > &av) const |
comparison operator | |
bool | operator> (const AVector2< T > &av) const |
comparison operator | |
const AVector2< T > & | operator+= (const AVector2< T > &v) |
in-place math operator | |
const AVector2< T > & | operator-= (const AVector2< T > &v) |
in-place math operator | |
const AVector2< T > & | operator*= (const AVector2< T > &v) |
in-place math operator | |
const AVector2< T > & | operator*= (const T &t) |
in-place math operator | |
const AVector2< T > & | operator/= (const AVector2< T > &v) |
in-place math operator | |
const AVector2< T > & | operator/= (const T &t) |
in-place math operator | |
AVector2< T > | operator+ (const AVector2< T > &av) const |
Binary math operator - require temp (till C++0x) | |
AVector2< T > | operator- (const AVector2< T > &av) const |
Binary math operator - require temp (till C++0x) | |
AVector2< T > | operator* (const AVector2< T > &av) const |
Binary math operator - require temp (till C++0x) | |
AVector2< T > | operator* (const T &t) const |
Binary math operator - require temp (till C++0x) | |
AVector2< T > | operator/ (const AVector2< T > &av) const |
Binary math operator - require temp (till C++0x) | |
AVector2< T > | operator/ (const T &t) const |
Binary math operator - require temp (till C++0x) | |
T | operator& (const AVector2< T > &) const |
Cross product with another AVector2 will always return 0.0. | |
Vector2< T > | operator& (const Vector2< T > &v) const |
Cross product with a Vector2 produces a Vector2. | |
Vector3< T > | operator& (const Vector3< T > &v) const |
Cross product with a Vector3 produces a Vector3 (z=0) | |
T | operator| (const AVector2< T > &v) const |
Dot product. | |
T | operator| (const Vector2< T > &) const |
Dot product with a Vector2 returns 0.0. | |
T | operator| (const Vector3< T > &v) const |
Dot product with a Vector3. | |
Vector2< T > | toVector2 () const |
Converts to a Vector2(0,0) | |
Vector3< T > | toVector3 () const |
Converts to a Vector3(0,0,z) | |
Related Symbols | |
(Note that these are not member symbols.) | |
typedef AVector2< double > | DAVect2 |
typedef AVector2< float > | FAVect2 |
typedef AVector2< int32 > | IAVect2 |
typedef AVector2< uint32 > | UAVect2 |
template<class T > | |
Vector2< T > | operator& (const Vector2< T > &v, const AVector2< T > &av) |
template<class T > | |
Vector3< T > | operator& (const Vector3< T > &v, const AVector2< T > &av) |
template<class T > | |
AVector2< T > | operator& (const Vector2< T > &v1, const Vector2< T > &v2) |
template<class T > | |
T | operator| (const Vector2< T > &, const AVector2< T > &) |
template<class T > | |
DAVect2 | toDAVect2 (const AVector2< T > &v) |
template<class T > | |
FAVect2 | toFAVect2 (const AVector2< T > &v) |
template<class T > | |
IAVect2 | toIAVect2 (const AVector2< T > &v) |
template<class T > | |
UAVect2 | toUAVect2 (const AVector2< T > &v) |
template<class T > | |
Vector2< T > | toVect2 (const AVector2< T > &) |
template<class T > | |
Vector3< T > | toVect3 (const AVector2< T > &v) |
template<class T > | |
const AVector2< T > & | toAVect2 (const AVector2< T > &v) |
template<class T > | |
AVector2< T > | toAVect2 (const AVector3< T > &v) |
template<class T > | |
AVector2< T > | vmax (const AVector2< T > &v1, const AVector2< T > &v2) |
template<class T > | |
AVector2< T > | vsign (const AVector2< T > &v1, const AVector2< T > &v2) |
2D Angular vector class.
This specialized version of a vector class is intended to store "angular" values, values that are a scalar in 2D (z component only) and a full vector in 3D.
The intention is to make it easier to write code that is the same in 2D and 3D without wasting computation time and storage.
In the 3D case, and AVector3 is a thin wrapper around a Vector3.
|
inline |
Returns a reference to the z component if u=2, any other value of u is an error.
|
inline |
General degree-of-freedom access. If u is 2 returns the z component, otherwise returns 0.0.