2D double floating point vector More...
#include <Vec2d.h>
Public Member Functions | |
Vec2d (double _a, double _b) | |
Vec2d (const Vec2i &v) | |
Vec2d (const Vec2f &v) | |
Vec2d (double a) | |
![]() | |
ArithVec2Float (doublea, doubleb) | |
Construct a 2D float vector. | |
ArithVec2Float () | |
Construct a 2D float vector. | |
![]() | |
ArithVecFloat (doublea) noexcept | |
ArithVecFloat (doublea, doubleb) noexcept | |
ArithVecFloat (doublea, doubleb, doublec) noexcept | |
ArithVecFloat (doublea, doubleb, doublec, doubled) noexcept | |
double | length () const |
Compute Euclidean length. | |
void | normalize () |
Normalize vector. | |
void | cond_normalize () |
Conditionally normalize vector. The condition being that the vector has non-zero length. | |
![]() | |
void | set (double_a, double_b) |
Set all coordinates of a 2D vector. | |
void | set (double_a, double_b, double_c) |
Set all coordinates of a 3D vector. | |
void | set (double_a, double_b, double_c, double_d) |
Set all coordinates of a 4D vector. | |
const double & | operator[] (unsigned int i) const |
Const index operator. | |
double & | operator[] (unsigned int i) |
Non-const index operator. | |
const double & | operator() (unsigned int i) const |
Const index operator. | |
double & | operator() (unsigned int i) |
Non-const index operator. | |
double * | get () |
const double * | get () const |
bool | operator== (const Vec2d &v) const |
Equality operator. | |
bool | operator== (doublek) const |
Equality wrt scalar. True if all coords are equal to scalar. | |
bool | operator!= (const Vec2d &v) const |
Inequality operator. | |
bool | operator!= (doublek) const |
Inequality wrt scalar. True if any coord not equal to scalar. | |
bool | all_l (const Vec2d &v) const |
bool | all_le (const Vec2d &v) const |
bool | all_g (const Vec2d &v) const |
bool | all_ge (const Vec2d &v) const |
const Vec2d & | operator*= (doublek) |
Assignment multiplication with scalar. | |
const Vec2d & | operator*= (const Vec2d &v) |
const Vec2d & | operator/= (doublek) |
Assignment division with scalar. | |
const Vec2d & | operator/= (const Vec2d &v) |
Assigment division with vector. Each coord divided independently. | |
const Vec2d & | operator+= (doublek) |
Assignment addition with scalar. Adds scalar to each coordinate. | |
const Vec2d & | operator+= (const Vec2d &v) |
Assignmment addition with vector. | |
const Vec2d & | operator-= (doublek) |
Assignment subtraction with scalar. Subtracts scalar from each coord. | |
const Vec2d & | operator-= (const Vec2d &v) |
Assignment subtraction with vector. | |
const Vec2d | operator- () const |
Negate vector. | |
const Vec2d | operator- (const Vec2d &v1) const |
Subtract two vectors. | |
const Vec2d | operator* (const Vec2d &v1) const |
const Vec2d | operator* (doublek) const |
Multiply scalar onto vector. | |
const Vec2d | operator+ (const Vec2d &v1) const |
Add two vectors. | |
const Vec2d | operator/ (const Vec2d &v1) const |
Divide two vectors. Each coord separately. | |
const Vec2d | operator/ (doublek) const |
Divide vector by scalar. | |
const double | min_coord () const |
Return the smallest coordinate of the vector. | |
const double | max_coord () const |
Return the largest coordinate of the vector. | |
Additional Inherited Members | |
![]() | |
typedef double | ScalarType |
For convenience we define a more meaningful name for the scalar type. | |
typedef Vec2d | VectorType |
A more meaningful name for vector type. | |
![]() | |
static unsigned int | get_dim () |
Return dimension of vector. | |
![]() | |
ArithVec () | |
Construct uninitialized vector. | |
ArithVec (double_a) | |
Construct a vector where all coordinates are identical. | |
ArithVec (double_a, double_b) | |
Construct a 2D vector. | |
ArithVec (double_a, double_b, double_c) | |
Construct a 3D vector. | |
ArithVec (double_a, double_b, double_c, double_d) | |
Construct a 4D vector. | |
![]() | |
double | data [N] |
The actual contents of the vector. | |
2D double floating point vector