|
| constexpr | Vec () |
| |
|
constexpr | Vec () |
| | Construct vector with both elements set to 0.
|
| |
| | Vec (const std::initializer_list< T > &items) |
| |
| constexpr | Vec (const T a[N]) |
| |
|
constexpr | Vec (const T v[2]) |
| | Construct a vector with elements copied from the 2-element array v.
|
| |
|
constexpr | Vec (const Vec< T, M > &...vecs) |
| | Construct a new vector by concatenating two or more vectors.
|
| |
| constexpr | Vec (const Vec< U, N-1 > &v, T a) |
| |
| | Vec (detail::MtxColIterator< Mx, Ref > mtx_col) |
| |
| constexpr | Vec (T a) |
| |
|
constexpr | Vec (T a) |
| | Construct a vector with both elements set to a.
|
| |
|
constexpr | Vec (T x, T y) |
| | Construct a vector with elements (x, y).
|
| |
| self_t | abs () const |
| | Element-wise absolute value.
|
| |
| self_t | add (const self_t &v) const |
| | Vector addition.
|
| |
| self_t | add (const self_t &v) const |
| | Vector addition.
|
| |
|
Vec< T, 2 > | add (T dx, T dy) const |
| | Addition. Convenience function with separate args for x and y.
|
| |
|
self_t | align (const self_t &from, const self_t &to) const |
| | Apply a rotation to this which aligns the unit vectors from with to.
|
| |
|
self_t | align (const self_t &from, const self_t &to) const |
| | Apply a rotation to this which aligns the unit vectors from with to.
|
| |
| T | angle () const |
| |
| T | angle_to (const self_t &v) const |
| | Angle between vectors.
|
| |
| T | angle_to (const self_t &v) const |
| | Angle between vectors.
|
| |
|
index_t | argmax () const |
| | Return the index of the coordinate with the largest absolute value.
|
| |
|
index_t | argmin () const |
| | Return the index of the coordinate with the smallest absolute value.
|
| |
| T * | begin () |
| |
| const T * | begin () const |
| |
| self_t | bounce_on (const self_t &normal) const |
| | Elastic collision.
|
| |
| self_t | bounce_on (const self_t &normal) const |
| | Elastic collision.
|
| |
| self_t | ceil () const |
| | Element-wise ceiling function.
|
| |
| self_t | clamp (const self_t &lo, const self_t &hi) const |
| | Element-wise clamp.
|
| |
| self_t | clamp (const self_t &lo, const self_t &hi) const |
| | Element-wise clamp.
|
| |
| T | dist (const self_t &pt) const |
| | Distance between points.
|
| |
| T | dist (const self_t &pt) const |
| | Distance between points.
|
| |
| T | dist2 (const self_t &pt) const |
| | Distance squared to a point.
|
| |
| T | dist2 (const self_t &pt) const |
| | Distance squared to a point.
|
| |
| T | dot (const self_t &v) const |
| | Dot product.
|
| |
| T | dot (const self_t &v) const |
| | Dot product.
|
| |
|
T | dot (T x1, T y1) const |
| | Dot product with the vector (x1, y1).
|
| |
| T * | end () |
| |
| const T * | end () const |
| |
| self_t | floor () const |
| | Element-wise floor function.
|
| |
| T | fraction_on (const self_t &axis) const |
| | Return the component of this that projects to axis, as a fraction of axis's length.
|
| |
| T | fraction_on (const self_t &axis) const |
| | Return the component of this that projects to axis, as a fraction of axis's length.
|
| |
| Vec< T, 2 > | from_polar () const |
| |
| T & | get (index_t idx) |
| |
| const T & | get (index_t idx) const |
| |
| bool | is_finite_real () const |
| |
|
bool | is_zero () const |
| | Return true if all elements are zero.
|
| |
| Vec< T, 2 > | left_perpendicular () const |
| |
| T | mag () const |
| | Euclidean norm (magnitude).
|
| |
| T | mag2 () const |
| | Squared magnitude.
|
| |
| self_t | max (const self_t &v) const |
| | Element-wise maximum of two Vecs.
|
| |
| T | max () const |
| | Maximum element.
|
| |
| self_t | max (const self_t &v) const |
| | Element-wise maximum of two Vecs.
|
| |
| self_t | min (const self_t &v) const |
| | Element-wise minimum of two Vecs.
|
| |
| T | min () const |
| | Minimum element.
|
| |
| self_t | min (const self_t &v) const |
| | Element-wise minimum of two Vecs.
|
| |
| self_t | mix (const self_t &v, T mix) const |
| | Linear interpolation.
|
| |
| self_t | mix (const self_t &v, T mix) const |
| | Linear interpolation.
|
| |
| | operator Vec< U, N > () const |
| | Element typecast.
|
| |
| bool | operator!= (const self_t &vv) const |
| | Inequality test.
|
| |
| bool | operator!= (const self_t &vv) const |
| | Inequality test.
|
| |
|
self_t & | operator*= (const self_t &vv) |
| | Element-wise multiplication and assignment.
|
| |
|
self_t & | operator*= (const self_t &vv) |
| | Element-wise multiplication and assignment.
|
| |
|
self_t & | operator*= (T s) |
| | Scalar multiplication and assignment.
|
| |
|
self_t | operator+ (const self_t &v) const |
| | Element-wise addition.
|
| |
|
self_t | operator+ (const self_t &v) const |
| | Element-wise addition.
|
| |
|
self_t & | operator+= (const self_t &vv) |
| | Element-wise addition and assignment.
|
| |
|
self_t & | operator+= (const self_t &vv) |
| | Element-wise addition and assignment.
|
| |
|
self_t | operator- (const self_t &v) const |
| | Element-wise subtraction.
|
| |
| self_t | operator- () const |
| | Negation.
|
| |
|
self_t | operator- (const self_t &v) const |
| | Element-wise subtraction.
|
| |
|
self_t & | operator-= (const self_t &vv) |
| | Subtraction and assignment.
|
| |
|
self_t & | operator-= (const self_t &vv) |
| | Subtraction and assignment.
|
| |
|
self_t & | operator/= (T s) |
| | Scalar division and assignment.
|
| |
| bool | operator== (const self_t &vv) const |
| | Equality test.
|
| |
| bool | operator== (const self_t &vv) const |
| | Equality test.
|
| |
| T & | operator[] (index_t idx) |
| | Vector element access.
|
| |
| const T & | operator[] (index_t idx) const |
| | Vector element access.
|
| |
|
T | product () const |
| | Multiply all elements together.
|
| |
| self_t | project_on (const self_t &axis) const |
| | Orthogonal projection to an axis.
|
| |
| self_t | project_on (const self_t &axis) const |
| | Orthogonal projection to an axis.
|
| |
| self_t | reflect_about (self_t normal) const |
| | Reflection about a normal.
|
| |
| self_t | reflect_about (self_t normal) const |
| | Reflection about a normal.
|
| |
| Vec< T, 2 > | reflected_x () const |
| |
| Vec< T, 2 > | reflected_y () const |
| |
| PointType< T, M >::point_t | resized () const |
| | Resized copy of a vector.
|
| |
| Vec< T, 2 > | right_perpendicular () const |
| |
| Vec< T, 2 > | rotate (Vec< T, 2 > center, T radians) const |
| |
| Vec< T, 2 > | rotated (T radians) const |
| |
|
self_t | round () const |
| | Round each element to the nearest integer.
|
| |
| self_t | scale (const self_t &v) const |
| | Element-wise multiplication.
|
| |
| self_t | scale (const self_t &v) const |
| | Element-wise multiplication.
|
| |
| self_t | scale (T a) const |
| | Scalar multiple.
|
| |
|
Vec< T, 2 > | scale (T sx, T sy) const |
| | Scalar multiplication. Convenience function with separate args for x and y.
|
| |
|
index_t | size () const |
| | The number of elements in this vector. Always equal to N.
|
| |
| self_t | sub (const self_t &v) const |
| | Vector subtraction.
|
| |
| self_t | sub (const self_t &v) const |
| | Vector subtraction.
|
| |
|
Vec< T, 2 > | sub (T dx, T dy) const |
| | Subtraction. Convenience function with separate args for x and y.
|
| |
|
T | sum () const |
| | Sum the elements of the vector.
|
| |
| Vec< T, 2 > | to_polar () const |
| |
| self_t | unit () const |
| | Vector normalization.
|
| |
| self_t | with_length (T mag) const |
| | Compute a vector with the direction of this and a new magnitude mag.
|
| |
|
(Note that these are not member symbols.)
|
| geom::Vec< T, N > | abs (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | abs (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | ceil (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | ceil (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | cos (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | cos (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | exp (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | exp (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | floor (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | floor (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | log (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | log (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | max (const geom::Vec< T, N > &a, const geom::Vec< T, N > &b) |
| |
| geom::Vec< T, N > | max (const geom::Vec< T, N > &a, const geom::Vec< T, N > &b) |
| |
| geom::Vec< T, N > | min (const geom::Vec< T, N > &a, const geom::Vec< T, N > &b) |
| |
| geom::Vec< T, N > | min (const geom::Vec< T, N > &a, const geom::Vec< T, N > &b) |
| |
| const Vec< T, N > | operator* (const Vec< T, N > &a, const Vec< T, N > &b) |
| |
| const Vec< T, N > | operator* (const Vec< T, N > &a, const Vec< T, N > &b) |
| |
| Vec< T, N > | operator* (const Vec< T, N > &v, U d) |
| |
| Vec< T, N > | operator* (const Vec< T, N > &v, U d) |
| |
| Vec< T, N > | operator* (U d, const Vec< T, N > &v) |
| |
| Vec< T, N > | operator* (U d, const Vec< T, N > &v) |
| |
| const Vec< T, N > | operator/ (const Vec< T, N > &a, const Vec< T, N > &b) |
| |
| const Vec< T, N > | operator/ (const Vec< T, N > &a, const Vec< T, N > &b) |
| |
| Vec< T, N > | operator/ (const Vec< T, N > &v, U d) |
| |
| Vec< T, N > | operator/ (const Vec< T, N > &v, U d) |
| |
| Vec< T, N > | operator/ (const Vec< T, N > &v, U d) |
| |
| Vec< T, N > | operator/ (const Vec< T, N > &v, U d) |
| |
| geom::Vec< T, N > | sin (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | sin (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | sqrt (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | sqrt (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | tan (const geom::Vec< T, N > &v) |
| |
| geom::Vec< T, N > | tan (const geom::Vec< T, N > &v) |
| |
template<typename T>
class geom::Vec< T, 2 >
2D specialization of vector class.
Vec<T,2>'s elements may be accessed under these equivalent naming schemes:
v.{x,y} // conventional Euclidean coordinate names
v.{s,t} // conventional parameterization coordinate names
v.{row,col} // matrix coordinate names
with the latter scheme intended for use as matrix coordinates. x, s, and row all refer to the same element.
Take special note that, in accordance with convention, row refers to the vertical position of a matrix element, despite being the first coordinate. This means that row, a vertical coordinate, aliases x, a traditionally horizontal coordinate. For this reason it is inadviseable to interchange usage of the "matrix coordinate" and "Euclidean" naming schemes.