geomc 1.0
A c++ linear algebra template library
Loading...
Searching...
No Matches
Vec< T, 2 > Class Template Reference

2D specialization of vector class. More...

#include <geomc/linalg/vecdetail/Vec2.h>

Inheritance diagram for Vec< T, 2 >:
VecCommon< T, N, Vec< T, N > > VecCommon< T, 2, Vec< T, 2 > > VecBase< T, N > Dimensional< T, N > VecBase< T, N > Dimensional< T, N >

Public Types

using elem_t
 The coordinate type of this object.
 
using point_t
 The type of a point in this object's space.
 
typedef Vec< T, Nself_t
 Self type. I.e., Vec<T,N> if a vector, Quat<T> if a quaternion.
 

Public Member Functions

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.
 
angle () const
 
angle_to (const self_t &v) const
 Angle between vectors.
 
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.
 
dist (const self_t &pt) const
 Distance between points.
 
dist (const self_t &pt) const
 Distance between points.
 
dist2 (const self_t &pt) const
 Distance squared to a point.
 
dist2 (const self_t &pt) const
 Distance squared to a point.
 
dot (const self_t &v) const
 Dot product.
 
dot (const self_t &v) const
 Dot product.
 
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.
 
fraction_on (const self_t &axis) const
 Return the component of this that projects to axis, as a fraction of axis's length.
 
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
 
mag () const
 Euclidean norm (magnitude).
 
mag2 () const
 Squared magnitude.
 
self_t max (const self_t &v) const
 Element-wise maximum of two Vecs.
 
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.
 
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_toperator*= (const self_t &vv)
 Element-wise multiplication and assignment.
 
self_toperator*= (const self_t &vv)
 Element-wise multiplication and assignment.
 
self_toperator*= (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_toperator+= (const self_t &vv)
 Element-wise addition and assignment.
 
self_toperator+= (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_toperator-= (const self_t &vv)
 Subtraction and assignment.
 
self_toperator-= (const self_t &vv)
 Subtraction and assignment.
 
self_toperator/= (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.
 
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.
 
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.
 

Static Public Attributes

static constexpr index_t N
 The dimension of this object.
 
static const self_t ones
 
static const self_t unit_x
 
static const Vec< T, 2 > X_AXIS
 (1, 0) vector constant
 
static const Vec< T, 2 > Y_AXIS
 (0, 1) vector constant
 
static const self_t zeros
 

Protected Attributes

v [N]
 

Related Symbols

(Note that these are not member symbols.)

geom::Vec< T, Nabs (const geom::Vec< T, N > &v)
 
geom::Vec< T, Nabs (const geom::Vec< T, N > &v)
 
geom::Vec< T, Nceil (const geom::Vec< T, N > &v)
 
geom::Vec< T, Nceil (const geom::Vec< T, N > &v)
 
geom::Vec< T, Ncos (const geom::Vec< T, N > &v)
 
geom::Vec< T, Ncos (const geom::Vec< T, N > &v)
 
geom::Vec< T, Nexp (const geom::Vec< T, N > &v)
 
geom::Vec< T, Nexp (const geom::Vec< T, N > &v)
 
geom::Vec< T, Nfloor (const geom::Vec< T, N > &v)
 
geom::Vec< T, Nfloor (const geom::Vec< T, N > &v)
 
geom::Vec< T, Nlog (const geom::Vec< T, N > &v)
 
geom::Vec< T, Nlog (const geom::Vec< T, N > &v)
 
geom::Vec< T, Nmax (const geom::Vec< T, N > &a, const geom::Vec< T, N > &b)
 
geom::Vec< T, Nmax (const geom::Vec< T, N > &a, const geom::Vec< T, N > &b)
 
geom::Vec< T, Nmin (const geom::Vec< T, N > &a, const geom::Vec< T, N > &b)
 
geom::Vec< T, Nmin (const geom::Vec< T, N > &a, const geom::Vec< T, N > &b)
 
const Vec< T, Noperator* (const Vec< T, N > &a, const Vec< T, N > &b)
 
const Vec< T, Noperator* (const Vec< T, N > &a, const Vec< T, N > &b)
 
Vec< T, Noperator* (const Vec< T, N > &v, U d)
 
Vec< T, Noperator* (const Vec< T, N > &v, U d)
 
Vec< T, Noperator* (U d, const Vec< T, N > &v)
 
Vec< T, Noperator* (U d, const Vec< T, N > &v)
 
const Vec< T, Noperator/ (const Vec< T, N > &a, const Vec< T, N > &b)
 
const Vec< T, Noperator/ (const Vec< T, N > &a, const Vec< T, N > &b)
 
Vec< T, Noperator/ (const Vec< T, N > &v, U d)
 
Vec< T, Noperator/ (const Vec< T, N > &v, U d)
 
Vec< T, Noperator/ (const Vec< T, N > &v, U d)
 
Vec< T, Noperator/ (const Vec< T, N > &v, U d)
 
geom::Vec< T, Nsin (const geom::Vec< T, N > &v)
 
geom::Vec< T, Nsin (const geom::Vec< T, N > &v)
 
geom::Vec< T, Nsqrt (const geom::Vec< T, N > &v)
 
geom::Vec< T, Nsqrt (const geom::Vec< T, N > &v)
 
geom::Vec< T, Ntan (const geom::Vec< T, N > &v)
 
geom::Vec< T, Ntan (const geom::Vec< T, N > &v)
 

Detailed Description

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.

Member Typedef Documentation

◆ point_t

using point_t

The type of a point in this object's space.

An N-vector of T if N > 1, otherwise a T.

Constructor & Destructor Documentation

◆ Vec() [1/6]

Vec ( )
inlineconstexpr

Construct a new vector with all elements set to zero.

◆ Vec() [2/6]

Vec ( T a)
inlineconstexpr

Construct a new vector with all elements set to the value of a.

Parameters
aScalar value

◆ Vec() [3/6]

Vec ( const T a[N])
inlineconstexpr

Construct a new vector with elements copied from a.

Parameters
aAn array of length N.

◆ Vec() [4/6]

Vec ( const Vec< U, N-1 > & v,
T a )
inlineconstexpr

Construct a new vector with the elements from v, with a as the last element.

Parameters
vA vector of dimension N - 1
aThe value of the last element

◆ Vec() [5/6]

Vec ( detail::MtxColIterator< Mx, Ref > mtx_col)
inline

Construct a vector from a column of a matrix.

Parameters
mtx_colA matrix column iterator (obtained via mtx.col(i)).

◆ Vec() [6/6]

Vec ( const std::initializer_list< T > & items)
inline

Construct a vector from a brace-initialization list.

Example: Vec<int,3> v = {2, 5, 8};

Parameters
itemsA brace-initializer list.

Member Function Documentation

◆ abs()

self_t abs ( ) const
inline

Element-wise absolute value.

Returns
A new vector x such that x[i] = abs(this[i]).

◆ add() [1/2]

self_t add ( const self_t & v) const
inlineinherited

Vector addition.

Parameters
vAnother vector.
Returns
A new vector x such that x[i] = this[i] + v[i].

◆ add() [2/2]

self_t add ( const self_t & v) const
inline

Vector addition.

Parameters
vAnother vector.
Returns
A new vector x such that x[i] = this[i] + v[i].

◆ angle()

template<typename T>
T angle ( ) const
inline
Returns
The angle in radians to this vector from the x-axis, between 0 and 2 * pi.

◆ angle_to() [1/2]

T angle_to ( const self_t & v) const
inlineinherited

Angle between vectors.

Parameters
vAnother vector.
Returns
Angle in radians between this and v, between 0 and pi.

◆ angle_to() [2/2]

T angle_to ( const self_t & v) const
inline

Angle between vectors.

Parameters
vAnother vector.
Returns
Angle in radians between this and v, between 0 and pi.

◆ begin() [1/2]

T * begin ( )
inline
Returns
A writeable iterator pointing at the first element.

◆ begin() [2/2]

const T * begin ( ) const
inline
Returns
A read-only iterator pointing at the first element.

◆ bounce_on() [1/2]

self_t bounce_on ( const self_t & normal) const
inlineinherited

Elastic collision.

Treat this as a velocity vector or incident ray; this function returns the velocity reflected off of a surface with normal normal. Convenience for -reflect_about(normal).

Parameters
normalNormal of surface to "bounce" on.
Returns
The "bounced" direction vector.

◆ bounce_on() [2/2]

self_t bounce_on ( const self_t & normal) const
inline

Elastic collision.

Treat this as a velocity vector or incident ray; this function returns the velocity reflected off of a surface with normal normal. Convenience for -reflect_about(normal).

Parameters
normalNormal of surface to "bounce" on.
Returns
The "bounced" direction vector.

◆ ceil()

self_t ceil ( ) const
inline

Element-wise ceiling function.

Returns
A new vector x such that x[i] = ceil(this[i]).

◆ clamp() [1/2]

self_t clamp ( const self_t & lo,
const self_t & hi ) const
inlineinherited

Element-wise clamp.

Parameters
loElement-wise lower extremes.
hiElement-wise upper extremes.
Returns
A new vector such that each element x[i] is clamped between lo[i] and hi[i].

◆ clamp() [2/2]

self_t clamp ( const self_t & lo,
const self_t & hi ) const
inline

Element-wise clamp.

Parameters
loElement-wise lower extremes.
hiElement-wise upper extremes.
Returns
A new vector such that each element x[i] is clamped between lo[i] and hi[i].

◆ dist() [1/2]

T dist ( const self_t & pt) const
inlineinherited

Distance between points.

Parameters
ptAnother point.
Returns
The distance between this and pt.

◆ dist() [2/2]

T dist ( const self_t & pt) const
inline

Distance between points.

Parameters
ptAnother point.
Returns
The distance between this and pt.

◆ dist2() [1/2]

T dist2 ( const self_t & pt) const
inlineinherited

Distance squared to a point.

Parameters
ptAnother point.
Returns
The square of the distance between this and pt.

◆ dist2() [2/2]

T dist2 ( const self_t & pt) const
inline

Distance squared to a point.

Parameters
ptAnother point.
Returns
The square of the distance between this and pt.

◆ dot() [1/2]

T dot ( const self_t & v) const
inlineinherited

Dot product.

Parameters
vAnother vector.
Returns
The dot product of this with v.

◆ dot() [2/2]

T dot ( const self_t & v) const
inline

Dot product.

Parameters
vAnother vector.
Returns
The dot product of this with v.

◆ end() [1/2]

T * end ( )
inline
Returns
A writeable iterator pointing just beyond the last element.

◆ end() [2/2]

const T * end ( ) const
inline
Returns
A read-only iterator pointing just beyond the last element.

◆ floor()

self_t floor ( ) const
inline

Element-wise floor function.

Returns
A new vector x such that x[i] = floor(this[i]).

◆ fraction_on() [1/2]

T fraction_on ( const self_t & axis) const
inlineinherited

Return the component of this that projects to axis, as a fraction of axis's length.

Parameters
axisAn arbitrary basis vector.

◆ fraction_on() [2/2]

T fraction_on ( const self_t & axis) const
inline

Return the component of this that projects to axis, as a fraction of axis's length.

Parameters
axisAn arbitrary basis vector.

◆ from_polar()

template<typename T>
Vec< T, 2 > from_polar ( ) const
inline
Returns
The cartesian (x, y) coordinates of this point interpreted as polar coordinates, with this[0] = r and this[1] = radians.

◆ get() [1/2]

T & get ( index_t idx)
inline

Get the element at index idx.

Parameters
idxIndex of element.
Returns
A reference to the element at idx.

◆ get() [2/2]

const T & get ( index_t idx) const
inline

Get the element at index idx.

Parameters
idxIndex of element.
Returns
A const reference to the element at idx.

◆ is_finite_real()

template<typename T>
bool is_finite_real ( ) const
inline
Returns
true if no elements are an infinity or NaN.

◆ left_perpendicular()

template<typename T>
Vec< T, 2 > left_perpendicular ( ) const
inline
Returns
A vector perpendicular to this, created by a rotation of 90 degrees counterclockwise.

◆ mag()

T mag ( ) const
inline

Euclidean norm (magnitude).

Returns
The Euclidean magnitude (geometric length) of this vector.

◆ mag2()

T mag2 ( ) const
inline

Squared magnitude.

Returns
The square of the magnitude of this vector.

◆ max() [1/3]

self_t max ( const self_t & v) const
inlineinherited

Element-wise maximum of two Vecs.

Parameters
vAnother vector.
Returns
A new vector x such that x[i] = max(this[i], v[i]).

◆ max() [2/3]

T max ( ) const
inline

Maximum element.

Returns
The value of the component with the highest value.

◆ max() [3/3]

self_t max ( const self_t & v) const
inline

Element-wise maximum of two Vecs.

Parameters
vAnother vector.
Returns
A new vector x such that x[i] = max(this[i], v[i]).

◆ min() [1/3]

self_t min ( const self_t & v) const
inlineinherited

Element-wise minimum of two Vecs.

Parameters
vAnother vector.
Returns
A new vector x such that x[i] = min(this[i], v[i]).

◆ min() [2/3]

T min ( ) const
inline

Minimum element.

Returns
The value of the component with the lowest value.

◆ min() [3/3]

self_t min ( const self_t & v) const
inline

Element-wise minimum of two Vecs.

Parameters
vAnother vector.
Returns
A new vector x such that x[i] = min(this[i], v[i]).

◆ mix() [1/2]

self_t mix ( const self_t & v,
T mix ) const
inlineinherited

Linear interpolation.

A mix parameter of 0 evaluates to this, while 1 is v.

Parameters
vAnother vector.
mixA mixing factor between 0 and 1.
Returns
A linear mixing of this with v.

◆ mix() [2/2]

self_t mix ( const self_t & v,
T mix ) const
inline

Linear interpolation.

A mix parameter of 0 evaluates to this, while 1 is v.

Parameters
vAnother vector.
mixA mixing factor between 0 and 1.
Returns
A linear mixing of this with v.

◆ operator Vec< U, N >()

operator Vec< U, N > ( ) const
inlineexplicit

Element typecast.

Returns
A new vector with all elements cast to type U.

◆ operator!=() [1/2]

bool operator!= ( const self_t & vv) const
inlineinherited

Inequality test.

Returns
true if any corresponding elements of this and vv are unequal, false otherwise.

◆ operator!=() [2/2]

bool operator!= ( const self_t & vv) const
inline

Inequality test.

Returns
true if any corresponding elements of this and vv are unequal, false otherwise.

◆ operator-()

self_t operator- ( ) const
inline

Negation.

Returns
A copy of this vector with all elements negated (i.e. a vector pointing in the opposite direction).

◆ operator==() [1/2]

bool operator== ( const self_t & vv) const
inlineinherited

Equality test.

Returns
true if all corresponding elements of this and vv are equal, false otherwise.

◆ operator==() [2/2]

bool operator== ( const self_t & vv) const
inline

Equality test.

Returns
true if all corresponding elements of this and vv are equal, false otherwise.

◆ operator[]() [1/2]

T & operator[] ( index_t idx)
inline

Vector element access.

Parameters
idxIndex of element to retrieve.
Returns
A reference to the element at index idx.

◆ operator[]() [2/2]

const T & operator[] ( index_t idx) const
inline

Vector element access.

Parameters
idxIndex of element to retrieve.
Returns
A read-only reference to the element at index idx.

◆ project_on() [1/2]

self_t project_on ( const self_t & axis) const
inlineinherited

Orthogonal projection to an axis.

Parameters
axisA direction vector.
Returns
A vector in direction axis with magnitude equal to the component of this aligned with axis.

◆ project_on() [2/2]

self_t project_on ( const self_t & axis) const
inline

Orthogonal projection to an axis.

Parameters
axisA direction vector.
Returns
A vector in direction axis with magnitude equal to the component of this aligned with axis.

◆ reflect_about() [1/2]

self_t reflect_about ( self_t normal) const
inlineinherited

Reflection about a normal.

Parameters
normalAxis of reflection.
Returns
A copy of this vector reflected across the given axis.

◆ reflect_about() [2/2]

self_t reflect_about ( self_t normal) const
inline

Reflection about a normal.

Parameters
normalAxis of reflection.
Returns
A copy of this vector reflected across the given axis.

◆ reflected_x()

template<typename T>
Vec< T, 2 > reflected_x ( ) const
inline
Returns
A new vector with the X component reflected.

◆ reflected_y()

template<typename T>
Vec< T, 2 > reflected_y ( ) const
inline
Returns
A new vector with the Y component reflected.

◆ resized()

PointType< T, M >::point_t resized ( ) const
inline

Resized copy of a vector.

Template Parameters
MDimension of new vector.
Returns
A new vector with size M. If M is larger than N, the new elements will be set to zero. If M is 1, then the return type is T.

◆ right_perpendicular()

template<typename T>
Vec< T, 2 > right_perpendicular ( ) const
inline
Returns
A vector perpendicular to this, created by a rotation of 90 degrees clockwise.

◆ rotate()

template<typename T>
Vec< T, 2 > rotate ( Vec< T, 2 > center,
T radians ) const
inline
Returns
A vector rotated counterclockwise by the angle radians about the point center.
Parameters
centerCenter of rotation.
radiansAngle of rotation.

◆ rotated()

template<typename T>
Vec< T, 2 > rotated ( T radians) const
inline
Returns
A vector rotated counterclockwise by the angle radians.
Parameters
radiansRotation angle in radians

◆ scale() [1/3]

self_t scale ( const self_t & v) const
inlineinherited

Element-wise multiplication.

Parameters
vAnother vector.
Returns
A new vector x such that x[i] = this[i] * v[i].

◆ scale() [2/3]

self_t scale ( const self_t & v) const
inline

Element-wise multiplication.

Parameters
vAnother vector.
Returns
A new vector x such that x[i] = this[i] * v[i].

◆ scale() [3/3]

self_t scale ( T a) const
inline

Scalar multiple.

Parameters
aA constant scale factor.
Returns
A new vector x such that x[i] = this[i] * a.

◆ sub() [1/2]

self_t sub ( const self_t & v) const
inlineinherited

Vector subtraction.

Parameters
vAnother vector.
Returns
A new vector x such that x[i] = this[i] - v[i].

◆ sub() [2/2]

self_t sub ( const self_t & v) const
inline

Vector subtraction.

Parameters
vAnother vector.
Returns
A new vector x such that x[i] = this[i] - v[i].

◆ to_polar()

template<typename T>
Vec< T, 2 > to_polar ( ) const
inline
Returns
The polar coordinates (r, angle) for this cartesian point, with angle in radians.

◆ unit()

self_t unit ( ) const
inline

Vector normalization.

Returns
A copy of this vector with unit length.

◆ with_length()

self_t with_length ( T mag) const
inline

Compute a vector with the direction of this and a new magnitude mag.

If this is the zero vector, it will remain unchanged.

Friends And Related Symbol Documentation

◆ abs() [1/2]

geom::Vec< T, N > abs ( const geom::Vec< T, N > & v)
related

Element-wise absolute value.

◆ abs() [2/2]

geom::Vec< T, N > abs ( const geom::Vec< T, N > & v)
related

Element-wise absolute value.

◆ ceil() [1/2]

geom::Vec< T, N > ceil ( const geom::Vec< T, N > & v)
related

Element-wise ceiling.

◆ ceil() [2/2]

geom::Vec< T, N > ceil ( const geom::Vec< T, N > & v)
related

Element-wise ceiling.

◆ cos() [1/2]

geom::Vec< T, N > cos ( const geom::Vec< T, N > & v)
related

Element-wise cosine.

◆ cos() [2/2]

geom::Vec< T, N > cos ( const geom::Vec< T, N > & v)
related

Element-wise cosine.

◆ exp() [1/2]

geom::Vec< T, N > exp ( const geom::Vec< T, N > & v)
related

Element-wise exponentiation (evi).

◆ exp() [2/2]

geom::Vec< T, N > exp ( const geom::Vec< T, N > & v)
related

Element-wise exponentiation (evi).

◆ floor() [1/2]

geom::Vec< T, N > floor ( const geom::Vec< T, N > & v)
related

Element-wise floor.

◆ floor() [2/2]

geom::Vec< T, N > floor ( const geom::Vec< T, N > & v)
related

Element-wise floor.

◆ log() [1/2]

geom::Vec< T, N > log ( const geom::Vec< T, N > & v)
related

Element-wise natural log.

◆ log() [2/2]

geom::Vec< T, N > log ( const geom::Vec< T, N > & v)
related

Element-wise natural log.

◆ max() [1/2]

geom::Vec< T, N > max ( const geom::Vec< T, N > & a,
const geom::Vec< T, N > & b )
related

Element-wise maximum.

◆ max() [2/2]

geom::Vec< T, N > max ( const geom::Vec< T, N > & a,
const geom::Vec< T, N > & b )
related

Element-wise maximum.

◆ min() [1/2]

geom::Vec< T, N > min ( const geom::Vec< T, N > & a,
const geom::Vec< T, N > & b )
related

Element-wise minimum.

◆ min() [2/2]

geom::Vec< T, N > min ( const geom::Vec< T, N > & a,
const geom::Vec< T, N > & b )
related

Element-wise minimum.

◆ operator*() [1/6]

const Vec< T, N > operator* ( const Vec< T, N > & a,
const Vec< T, N > & b )
related

Element-wise vector multiplication

Parameters
aA vector
bA vector
Returns
A new vector x such that x[i] = a[i] * b[i]

◆ operator*() [2/6]

const Vec< T, N > operator* ( const Vec< T, N > & a,
const Vec< T, N > & b )
related

Element-wise vector multiplication

Parameters
aA vector
bA vector
Returns
A new vector x such that x[i] = a[i] * b[i]

◆ operator*() [3/6]

Vec< T, N > operator* ( const Vec< T, N > & v,
U d )
related

Vector-scalar multiplication

Parameters
vA vector
dScalar value of type satisfying std::is_scalar
Returns
A new vector x such that x[i] = v[i] * d

◆ operator*() [4/6]

Vec< T, N > operator* ( const Vec< T, N > & v,
U d )
related

Vector-scalar multiplication

Parameters
vA vector
dScalar value of type satisfying std::is_scalar
Returns
A new vector x such that x[i] = v[i] * d

◆ operator*() [5/6]

Vec< T, N > operator* ( U d,
const Vec< T, N > & v )
related

Vector-scalar multiplication

Parameters
dScalar value of type satisfying std::is_scalar
vA vector
Returns
A new vector x such that x[i] = d * v[i]

◆ operator*() [6/6]

Vec< T, N > operator* ( U d,
const Vec< T, N > & v )
related

Vector-scalar multiplication

Parameters
dScalar value of type satisfying std::is_scalar
vA vector
Returns
A new vector x such that x[i] = d * v[i]

◆ operator/() [1/6]

const Vec< T, N > operator/ ( const Vec< T, N > & a,
const Vec< T, N > & b )
related

Element-wise vector division

Parameters
aA vector
bA vector
Returns
A new vector x such that x[i] = a[i] / b[i]

◆ operator/() [2/6]

const Vec< T, N > operator/ ( const Vec< T, N > & a,
const Vec< T, N > & b )
related

Element-wise vector division

Parameters
aA vector
bA vector
Returns
A new vector x such that x[i] = a[i] / b[i]

◆ operator/() [3/6]

Vec< T, N > operator/ ( const Vec< T, N > & v,
U d )
related

Vector division by a scalar

Parameters
vA vector
dScalar value
Returns
A new vector x such that x[i] = v[i] / d

◆ operator/() [4/6]

Vec< T, N > operator/ ( const Vec< T, N > & v,
U d )
related

Vector division by a scalar

Parameters
vA vector
dScalar value
Returns
A new vector x such that x[i] = v[i] / d

◆ operator/() [5/6]

Vec< T, N > operator/ ( const Vec< T, N > & v,
U d )
related

Scalar division by a vector

Parameters
dScalar value
vA vector
Returns
A new vector x such that x[i] = d / v[i]

◆ operator/() [6/6]

Vec< T, N > operator/ ( const Vec< T, N > & v,
U d )
related

Scalar division by a vector

Parameters
dScalar value
vA vector
Returns
A new vector x such that x[i] = d / v[i]

◆ sin() [1/2]

geom::Vec< T, N > sin ( const geom::Vec< T, N > & v)
related

Element-wise sine.

◆ sin() [2/2]

geom::Vec< T, N > sin ( const geom::Vec< T, N > & v)
related

Element-wise sine.

◆ sqrt() [1/2]

geom::Vec< T, N > sqrt ( const geom::Vec< T, N > & v)
related

Element-wise square root.

◆ sqrt() [2/2]

geom::Vec< T, N > sqrt ( const geom::Vec< T, N > & v)
related

Element-wise square root.

◆ tan() [1/2]

geom::Vec< T, N > tan ( const geom::Vec< T, N > & v)
related

Element-wise tangent.

◆ tan() [2/2]

geom::Vec< T, N > tan ( const geom::Vec< T, N > & v)
related

Element-wise tangent.


The documentation for this class was generated from the following files: