[nnm] No Nonsense Math 0.5.0
A No-Nonsense, C++ 17, single-header-only Math library geared towards graphics programming.
Loading...
Searching...
No Matches
nnm::Vector3< Real > Class Template Reference

#include <nnm.hpp>

Public Member Functions

constexpr Vector3 ()
template<typename Int>
constexpr Vector3 (const Vector3i< Int > &vector)
template<typename Other>
constexpr Vector3 (const Vector3< Other > &vector)
constexpr Vector3 (const Vector2< Real > &vector, const Real z)
constexpr Vector3 (const Real x, const Real y, const Real z)
constexpr Vector3 abs () const
Vector3 ceil () const
Vector3 floor () const
Vector3 round () const
constexpr Vector3 clamp (const Vector3 &min, const Vector3 &max) const
Vector3 direction (const Vector3 &to) const
constexpr Vector3 direction_unnormalized (const Vector3 &to) const
constexpr Real distance_sqrd (const Vector3 &to) const
Real distance (const Vector3 &to) const
constexpr Real manhattan_distance (const Vector3 &to) const
constexpr Real length_sqrd () const
Real length () const
Vector3 clamp_length (const Real min, const Real max) const
Vector3 normalize () const
constexpr Vector3 lerp (const Vector3 &to, const Real weight) const
constexpr Vector3 lerp_clamped (const Vector3 &to, const Real weight) const
constexpr Real dot (const Vector3 &other) const
constexpr Vector3 cross (const Vector3 &other) const
constexpr Matrix3< Real > outer (const Vector3 &other) const
constexpr Vector3 reflect (const Vector3 &normal) const
constexpr Vector3 project (const Vector3 &onto) const
constexpr Vector3 inverse () const
Real angle (const Vector3 &to) const
constexpr bool parallel (const Vector3 &other) const
constexpr bool perpendicular (const Vector3 &other) const
constexpr Vector3 arbitrary_perpendicular () const
constexpr Vector3 translate (const Vector3 &by) const
Vector3 rotate_axis_angle (const Vector3 &axis, Real angle) const
Vector3 rotate_axis_angle_at (const Vector3 &origin, const Vector3 &axis, Real angle) const
constexpr Vector3 rotate_quaternion (const Quaternion< Real > &quaternion) const
constexpr Vector3 rotate_quaternion_at (const Vector3 &origin, const Quaternion< Real > &quaternion) const
constexpr Vector3 scale (const Vector3 &factor) const
constexpr Vector3 scale_at (const Vector3 &origin, const Vector3 &factor) const
constexpr Vector3 shear_x (Real factor_y, Real factor_z) const
constexpr Vector3 shear_x_at (const Vector3 &origin, Real factor_y, Real factor_z) const
constexpr Vector3 shear_y (Real factor_x, Real factor_z) const
constexpr Vector3 shear_y_at (const Vector3 &origin, Real factor_x, Real factor_z) const
constexpr Vector3 shear_z (Real factor_x, Real factor_y) const
constexpr Vector3 shear_z_at (const Vector3 &origin, Real factor_x, Real factor_y) const
constexpr Vector3 transform (const Basis3< Real > &by) const
constexpr Vector3 transform_at (const Vector3 &origin, const Basis3< Real > &by) const
constexpr Vector3 transform (const Transform2< Real > &by) const
constexpr Vector3 transform_at (const Vector2< Real > &origin, const Transform2< Real > &by) const
constexpr Vector3 transform (const Transform3< Real > &by, Real w=static_cast< Real >(1)) const
constexpr Vector3 transform_at (const Vector3 &origin, const Transform3< Real > &by, Real w=static_cast< Real >(1)) const
constexpr Real max () const
constexpr Real abs_max () const
constexpr Real min () const
constexpr Real abs_min () const
constexpr uint8_t max_index () const
constexpr uint8_t abs_max_index () const
constexpr uint8_t min_index () const
constexpr uint8_t abs_min_index () const
constexpr bool approx_equal (const Vector3 &other) const
constexpr bool approx_zero () const
constexpr Vector2< Real > xy () const
const Real * begin () const
const Real * end () const
Real * begin ()
Real * end ()
constexpr const Real & at (const uint8_t index) const
constexpr Real & at (const uint8_t index)
constexpr const Real & operator[] (const uint8_t index) const
constexpr Real & operator[] (const uint8_t index)
constexpr bool operator== (const Vector3 &other) const
constexpr bool operator!= (const Vector3 &other) const
constexpr Vector3 operator+ (const Vector3 &other) const
constexpr Vector3operator+= (const Vector3 &other)
constexpr Vector3 operator- (const Vector3 &other) const
constexpr Vector3operator-= (const Vector3 &other)
constexpr Vector3 operator* (const Vector3 &other) const
constexpr Vector3operator*= (const Vector3 &other)
constexpr Vector3 operator* (const Matrix3< Real > &matrix) const
constexpr Vector3 operator* (const Real value) const
constexpr Vector3operator*= (const Real value)
constexpr Vector3 operator/ (const Vector3 &other) const
constexpr Vector3operator/= (const Vector3 &other)
constexpr Vector3 operator/ (const Real value) const
constexpr Vector3operator/= (const Real value)
constexpr Vector3 operator+ () const
constexpr Vector3 operator- () const
constexpr bool operator< (const Vector3 &other) const
constexpr operator bool () const

Static Public Member Functions

static constexpr Vector3 all (Real value)
static constexpr Vector3 zero ()
static constexpr Vector3 one ()
static constexpr Vector3 axis_x ()
static constexpr Vector3 axis_y ()
static constexpr Vector3 axis_z ()

Public Attributes

Real x
Real y
Real z

Detailed Description

template<typename Real>
class nnm::Vector3< Real >

three-dimensional vector.

Template Parameters
RealFloating-point type.

Constructor & Destructor Documentation

◆ Vector3() [1/5]

template<typename Real>
nnm::Vector3< Real >::Vector3 ( )
inlineconstexpr

Initializes all components to zero.

◆ Vector3() [2/5]

template<typename Real>
template<typename Int>
nnm::Vector3< Real >::Vector3 ( const Vector3i< Int > & vector)
explicitconstexpr

Casts from three-dimensional integer vector.

Template Parameters
IntInteger type.
Parameters
vectorVector to cast.

◆ Vector3() [3/5]

template<typename Real>
template<typename Other>
nnm::Vector3< Real >::Vector3 ( const Vector3< Other > & vector)
inlineexplicitconstexpr

Casts from other vector.

Template Parameters
OtherOther floating-point type.
Parameters
vectorVector to cast.

◆ Vector3() [4/5]

template<typename Real>
nnm::Vector3< Real >::Vector3 ( const Vector2< Real > & vector,
const Real z )
inlineconstexpr

Initialize initial components with two-dimensional vector and z with value.

Parameters
vectorTwo-dimensional vector.
zZ value

◆ Vector3() [5/5]

template<typename Real>
nnm::Vector3< Real >::Vector3 ( const Real x,
const Real y,
const Real z )
inlineconstexpr

Initialize with components.

Parameters
xX value.
yY value.
zZ value.

Member Function Documentation

◆ abs()

template<typename Real>
Vector3 nnm::Vector3< Real >::abs ( ) const
inlinenodiscardconstexpr

Component-wise absolute value.

Returns
Result.

◆ abs_max()

template<typename Real>
Real nnm::Vector3< Real >::abs_max ( ) const
inlinenodiscardconstexpr

Absolute-value maximum component.

Returns
Result.

◆ abs_max_index()

template<typename Real>
uint8_t nnm::Vector3< Real >::abs_max_index ( ) const
inlinenodiscardconstexpr

Index of the absolute-value maximum component.

Returns
Index.

◆ abs_min()

template<typename Real>
Real nnm::Vector3< Real >::abs_min ( ) const
inlinenodiscardconstexpr

Absolute-value minimum component.

Returns
Result.

◆ abs_min_index()

template<typename Real>
uint8_t nnm::Vector3< Real >::abs_min_index ( ) const
inlinenodiscardconstexpr

Index of the absolute-value minimum component.

Returns
Index.

◆ all()

template<typename Real>
constexpr Vector3 nnm::Vector3< Real >::all ( Real value)
inlinestaticconstexpr

Vector with all components with value.

Parameters
valueValue.
Returns
Result.

◆ angle()

template<typename Real>
Real nnm::Vector3< Real >::angle ( const Vector3< Real > & to) const
inlinenodiscard

Angle in radians from this position vector to another position vector.

Parameters
toPosition to.
Returns
Resulting angle in radians.

◆ approx_equal()

template<typename Real>
bool nnm::Vector3< Real >::approx_equal ( const Vector3< Real > & other) const
inlinenodiscardconstexpr

If approximately equal to another vector.

Parameters
otherOther vector.
Returns
True if approximately equal, false otherwise.

◆ approx_zero()

template<typename Real>
bool nnm::Vector3< Real >::approx_zero ( ) const
inlinenodiscardconstexpr

If all components are approximately zero.

Returns
True if approximately zero, false otherwise.

◆ arbitrary_perpendicular()

template<typename Real>
Vector3 nnm::Vector3< Real >::arbitrary_perpendicular ( ) const
inlinenodiscardconstexpr

Returns a vector that is perpendicular to this vector. There are multiple possible perpendicular vectors so an arbitrary perpendicular vector is returned and no assumptions should be made on which solution is returned.

Returns
Resulting perpendicular vector.

◆ at() [1/2]

template<typename Real>
Real & nnm::Vector3< Real >::at ( const uint8_t index)
inlineconstexpr

Reference to component at index.

Parameters
indexIndex.
Returns
Reference.

◆ at() [2/2]

template<typename Real>
const Real & nnm::Vector3< Real >::at ( const uint8_t index) const
inlinenodiscardconstexpr

Constant reference to component at index.

Parameters
indexIndex.
Returns
Constant reference.

◆ axis_x()

template<typename Real>
constexpr Vector3 nnm::Vector3< Real >::axis_x ( )
inlinestaticconstexpr

Normalized vector that points in the direction of the positive x-axis.

Returns
Result.

◆ axis_y()

template<typename Real>
constexpr Vector3 nnm::Vector3< Real >::axis_y ( )
inlinestaticconstexpr

Normalized vector that points in the direction of the positive y-axis.

Returns
Result.

◆ axis_z()

template<typename Real>
constexpr Vector3 nnm::Vector3< Real >::axis_z ( )
inlinestaticconstexpr

Normalized vector that points in the direction of the positive z-axis.

Returns
Result.

◆ begin() [1/2]

template<typename Real>
Real * nnm::Vector3< Real >::begin ( )
inline

Start iterator.

Returns
Iterator.

◆ begin() [2/2]

template<typename Real>
const Real * nnm::Vector3< Real >::begin ( ) const
inlinenodiscard

Start constant iterator.

Returns
Constant iterator.

◆ ceil()

template<typename Real>
Vector3 nnm::Vector3< Real >::ceil ( ) const
inlinenodiscard

Component-wise ceiling.

Returns
Result.

◆ clamp()

template<typename Real>
Vector3 nnm::Vector3< Real >::clamp ( const Vector3< Real > & min,
const Vector3< Real > & max ) const
inlinenodiscardconstexpr

Component-wise clamp.

Parameters
minMinimum.
maxMaximum.
Returns
Result.

◆ clamp_length()

template<typename Real>
Vector3 nnm::Vector3< Real >::clamp_length ( const Real min,
const Real max ) const
inlinenodiscard

Clamp length.

Parameters
minMinimum.
maxMaximum.
Returns
Result.

◆ cross()

template<typename Real>
Vector3 nnm::Vector3< Real >::cross ( const Vector3< Real > & other) const
inlinenodiscardconstexpr

Vector cross product.

Parameters
otherOther vector.
Returns
Result.

◆ direction()

template<typename Real>
Vector3 nnm::Vector3< Real >::direction ( const Vector3< Real > & to) const
inlinenodiscard

The direction from position of this vector to the position of another vector.

Parameters
toPosition to.
Returns
Resulting normalized direction vector.

◆ direction_unnormalized()

template<typename Real>
Vector3 nnm::Vector3< Real >::direction_unnormalized ( const Vector3< Real > & to) const
inlinenodiscardconstexpr

The non-normalized direction from position of this vector to the position of another vector.

Parameters
toPosition to.
Returns
Resulting non-normalized direction vector.

◆ distance()

template<typename Real>
Real nnm::Vector3< Real >::distance ( const Vector3< Real > & to) const
inlinenodiscard

Distance from the position of this vector to the position of another vector.

Parameters
toPosition to.
Returns
Result.

◆ distance_sqrd()

template<typename Real>
Real nnm::Vector3< Real >::distance_sqrd ( const Vector3< Real > & to) const
inlinenodiscardconstexpr

Squared distance from the position of this vector to the position of another vector.

Parameters
toPosition to.
Returns
Resulting squared distance.

◆ dot()

template<typename Real>
Real nnm::Vector3< Real >::dot ( const Vector3< Real > & other) const
inlinenodiscardconstexpr

Vector dot product.

Parameters
otherOther vector.
Returns
Result.

◆ end() [1/2]

template<typename Real>
Real * nnm::Vector3< Real >::end ( )
inline

End iterator.

Returns
Iterator.

◆ end() [2/2]

template<typename Real>
const Real * nnm::Vector3< Real >::end ( ) const
inlinenodiscard

End constant iterator.

Returns
Constant iterator.

◆ floor()

template<typename Real>
Vector3 nnm::Vector3< Real >::floor ( ) const
inlinenodiscard

Component-wise floor.

Returns
Result.

◆ inverse()

template<typename Real>
Vector3 nnm::Vector3< Real >::inverse ( ) const
inlinenodiscardconstexpr

Inverse vector.

Returns
Result.

◆ length()

template<typename Real>
Real nnm::Vector3< Real >::length ( ) const
inlinenodiscard

Vector length.

Returns
Result.

◆ length_sqrd()

template<typename Real>
Real nnm::Vector3< Real >::length_sqrd ( ) const
inlinenodiscardconstexpr

Squared vector length.

Returns
Resulting squared length.

◆ lerp()

template<typename Real>
Vector3 nnm::Vector3< Real >::lerp ( const Vector3< Real > & to,
const Real weight ) const
inlinenodiscardconstexpr

Linear interpolate from this vector to another.

Parameters
toVector to interpolate to.
weightInterpolation weight which typically ranges from zero to one.
Returns
Result.

◆ lerp_clamped()

template<typename Real>
Vector3 nnm::Vector3< Real >::lerp_clamped ( const Vector3< Real > & to,
const Real weight ) const
inlinenodiscardconstexpr

Linear interpolate from this vector to another which a clamped weight between zero and one.

Parameters
toVector to interpolate to.
weightInterpolation weight which is clamped from zero to one.
Returns
Result.

◆ manhattan_distance()

template<typename Real>
Real nnm::Vector3< Real >::manhattan_distance ( const Vector3< Real > & to) const
inlinenodiscardconstexpr

Distance between the position of this vector to another vector along the grid defined by the x, y, and z axes.

Parameters
toPosition to.
Returns
Result.

◆ max()

template<typename Real>
Real nnm::Vector3< Real >::max ( ) const
inlinenodiscardconstexpr

Maximum component.

Returns
Result.

◆ max_index()

template<typename Real>
uint8_t nnm::Vector3< Real >::max_index ( ) const
inlinenodiscardconstexpr

Index of the maximum component.

Returns
Index.

◆ min()

template<typename Real>
Real nnm::Vector3< Real >::min ( ) const
inlinenodiscardconstexpr

Minimum component.

Returns
Result.

◆ min_index()

template<typename Real>
uint8_t nnm::Vector3< Real >::min_index ( ) const
inlinenodiscardconstexpr

Index of the minimum component.

Returns
Index.

◆ normalize()

template<typename Real>
Vector3 nnm::Vector3< Real >::normalize ( ) const
inlinenodiscard

Normalize vector length to one.

Returns
Result.

◆ one()

template<typename Real>
constexpr Vector3 nnm::Vector3< Real >::one ( )
inlinestaticconstexpr

Vector with all components one.

Returns
Result.

◆ operator bool()

template<typename Real>
nnm::Vector3< Real >::operator bool ( ) const
inlineexplicitnodiscardconstexpr

Evaluates to false if all components are zero, true otherwise.

◆ operator!=()

template<typename Real>
bool nnm::Vector3< Real >::operator!= ( const Vector3< Real > & other) const
inlinenodiscardconstexpr

If unequal to another vector.

Parameters
otherOther vector.
Returns
True if unequal, false otherwise.

◆ operator*() [1/3]

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::operator* ( const Matrix3< Real > & matrix) const
nodiscardconstexpr

Vector-matrix multiplication.

Parameters
matrix3x3 Matrix.
Returns
Result.

◆ operator*() [2/3]

template<typename Real>
Vector3 nnm::Vector3< Real >::operator* ( const Real value) const
inlinenodiscardconstexpr

Component-wise multiplication with value.

Parameters
valueValue.
Returns
Result.

◆ operator*() [3/3]

template<typename Real>
Vector3 nnm::Vector3< Real >::operator* ( const Vector3< Real > & other) const
inlinenodiscardconstexpr

Component-wise multiplication.

Parameters
otherOther vector.
Returns
Result.

◆ operator*=() [1/2]

template<typename Real>
Vector3 & nnm::Vector3< Real >::operator*= ( const Real value)
inlineconstexpr

Component-wise multiplication with value.

Parameters
valueValue.
Returns
Reference to this modified vector.

◆ operator*=() [2/2]

template<typename Real>
Vector3 & nnm::Vector3< Real >::operator*= ( const Vector3< Real > & other)
inlineconstexpr

Component-wise multiplication.

Parameters
otherOther vector.
Returns
Reference to this modified vector.

◆ operator+() [1/2]

template<typename Real>
Vector3 nnm::Vector3< Real >::operator+ ( ) const
inlinenodiscardconstexpr

Unary plus. Does nothing but provides symmetry with unary minus.

Returns
Result.

◆ operator+() [2/2]

template<typename Real>
Vector3 nnm::Vector3< Real >::operator+ ( const Vector3< Real > & other) const
inlinenodiscardconstexpr

Component-wise addition.

Parameters
otherOther vector.
Returns
Result.

◆ operator+=()

template<typename Real>
Vector3 & nnm::Vector3< Real >::operator+= ( const Vector3< Real > & other)
inlineconstexpr

Component-wise addition.

Parameters
otherOther vector.
Returns
Reference to this modified vector.

◆ operator-() [1/2]

template<typename Real>
Vector3 nnm::Vector3< Real >::operator- ( ) const
inlinenodiscardconstexpr

Component-wise negation.

Returns
Result.

◆ operator-() [2/2]

template<typename Real>
Vector3 nnm::Vector3< Real >::operator- ( const Vector3< Real > & other) const
inlinenodiscardconstexpr

Component-wise subtraction.

Parameters
otherOther vector.
Returns
Result.

◆ operator-=()

template<typename Real>
Vector3 & nnm::Vector3< Real >::operator-= ( const Vector3< Real > & other)
inlineconstexpr

Component-wise subtraction.

Parameters
otherOther vector.
Returns
Reference to this modified vector.

◆ operator/() [1/2]

template<typename Real>
Vector3 nnm::Vector3< Real >::operator/ ( const Real value) const
inlinenodiscardconstexpr

Component-wise division with value.

Parameters
valueValue
Returns
Result.

◆ operator/() [2/2]

template<typename Real>
Vector3 nnm::Vector3< Real >::operator/ ( const Vector3< Real > & other) const
inlinenodiscardconstexpr

Component-wise division.

Parameters
otherOther vector.
Returns
Result.

◆ operator/=() [1/2]

template<typename Real>
Vector3 & nnm::Vector3< Real >::operator/= ( const Real value)
inlineconstexpr

Component-wise division with value.

Parameters
valueValue.
Returns
Reference to this modified vector.

◆ operator/=() [2/2]

template<typename Real>
Vector3 & nnm::Vector3< Real >::operator/= ( const Vector3< Real > & other)
inlineconstexpr

Component-wise division.

Parameters
otherOther vector.
Returns
Reference to this modified vector.

◆ operator<()

template<typename Real>
bool nnm::Vector3< Real >::operator< ( const Vector3< Real > & other) const
inlinenodiscardconstexpr

Lexicographical comparison between components.

Parameters
otherOther vector.
Returns
True if less than, false otherwise.

◆ operator==()

template<typename Real>
bool nnm::Vector3< Real >::operator== ( const Vector3< Real > & other) const
inlinenodiscardconstexpr

If all components are equal to another vector.

Parameters
otherOther vector.
Returns
True if equal, false otherwise.

◆ operator[]() [1/2]

template<typename Real>
Real & nnm::Vector3< Real >::operator[] ( const uint8_t index)
inlineconstexpr

Reference to component at index.

Parameters
indexIndex.
Returns
Reference.

◆ operator[]() [2/2]

template<typename Real>
const Real & nnm::Vector3< Real >::operator[] ( const uint8_t index) const
inlinenodiscardconstexpr

Constant reference to component at index.

Parameters
indexIndex.
Returns
Constant reference.

◆ outer()

template<typename Real>
Matrix3< Real > nnm::Vector3< Real >::outer ( const Vector3< Real > & other) const
nodiscardconstexpr

Vector outer product.

Parameters
otherOther vector.
Returns
Resulting 3x3 matrix.

◆ parallel()

template<typename Real>
bool nnm::Vector3< Real >::parallel ( const Vector3< Real > & other) const
inlinenodiscardconstexpr

If this vector is parallel to another vector.

Parameters
otherOther vector.
Returns
True if parallel, false otherwise.

◆ perpendicular()

template<typename Real>
bool nnm::Vector3< Real >::perpendicular ( const Vector3< Real > & other) const
inlinenodiscardconstexpr

If this vector is perpendicular to another vector.

Parameters
otherOther vector.
Returns
True if perpendicular, false otherwise.

◆ project()

template<typename Real>
Vector3 nnm::Vector3< Real >::project ( const Vector3< Real > & onto) const
inlinenodiscardconstexpr

Project this vector onto another

Parameters
ontoVector to project onto.
Returns
Result.

◆ reflect()

template<typename Real>
Vector3 nnm::Vector3< Real >::reflect ( const Vector3< Real > & normal) const
inlinenodiscardconstexpr

Reflect this vector based on a normal vector.

Parameters
normalNormal vector.
Returns
Result.

◆ rotate_axis_angle()

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::rotate_axis_angle ( const Vector3< Real > & axis,
Real angle ) const
nodiscard

Rotate via normalized axis and angle in radians about the origin.

Parameters
axisNormalized axis.
angleAngle in radians.
Returns
Result.

◆ rotate_axis_angle_at()

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::rotate_axis_angle_at ( const Vector3< Real > & origin,
const Vector3< Real > & axis,
Real angle ) const
nodiscard

Rotate via normalized axis and angle in radians around an origin.

Parameters
originOrigin to rotate about.
axisNormalized axis.
angleAngle in radians.
Returns
Result.

◆ rotate_quaternion()

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::rotate_quaternion ( const Quaternion< Real > & quaternion) const
nodiscardconstexpr

Rotate via quaternion about the origin.

Parameters
quaternionQuaternion.
Returns
Result.

◆ rotate_quaternion_at()

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::rotate_quaternion_at ( const Vector3< Real > & origin,
const Quaternion< Real > & quaternion ) const
nodiscardconstexpr

Rotate via quaternion about an origin.

Parameters
originOrigin to rotate about.
quaternionQuaternion
Returns
Result.

◆ round()

template<typename Real>
Vector3 nnm::Vector3< Real >::round ( ) const
inlinenodiscard

Component-wise round.

Returns
Result.

◆ scale()

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::scale ( const Vector3< Real > & factor) const
nodiscardconstexpr

Component-wise scale about the origin.

Parameters
factorScale factor.
Returns
Result.

◆ scale_at()

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::scale_at ( const Vector3< Real > & origin,
const Vector3< Real > & factor ) const
nodiscardconstexpr

Component-wise scale about an origin.

Parameters
originOrigin to scale bout.
factorScale factor.
Returns
Result.

◆ shear_x()

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::shear_x ( Real factor_y,
Real factor_z ) const
nodiscardconstexpr

Shear along x-axis about the origin.

Parameters
factor_yY-Axis factor.
factor_zZ-Axis factor.
Returns
Result.

◆ shear_x_at()

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::shear_x_at ( const Vector3< Real > & origin,
Real factor_y,
Real factor_z ) const
nodiscardconstexpr

Shear along x-axis about an origin.

Parameters
originOrigin to shear about.
factor_yY-Axis factor.
factor_zZ-Axis factor.
Returns
Result.

◆ shear_y()

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::shear_y ( Real factor_x,
Real factor_z ) const
nodiscardconstexpr

Shear along y-axis about the origin.

Parameters
factor_xX-Axis factor.
factor_zZ-Axis factor.
Returns
Result.

◆ shear_y_at()

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::shear_y_at ( const Vector3< Real > & origin,
Real factor_x,
Real factor_z ) const
nodiscardconstexpr

Shear along y-axis about the origin.

Parameters
originOrigin to shear about.
factor_xX-Axis factor.
factor_zZ-Axis factor.
Returns
Result.

◆ shear_z()

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::shear_z ( Real factor_x,
Real factor_y ) const
nodiscardconstexpr

Shear along z-axis about the origin.

Parameters
factor_xX-Axis factor.
factor_yY-Axis factor.
Returns
Result.

◆ shear_z_at()

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::shear_z_at ( const Vector3< Real > & origin,
Real factor_x,
Real factor_y ) const
nodiscardconstexpr

Shear along z-axis about an origin.

Parameters
originOrigin to shear about.
factor_xX-Axis factor.
factor_yY-Axis factor.
Returns
Result.

◆ transform() [1/3]

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::transform ( const Basis3< Real > & by) const
nodiscardconstexpr

Transform by a three-dimensional basis matrix about the origin.

Parameters
byBasis to transform by.
Returns
Result.

◆ transform() [2/3]

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::transform ( const Transform2< Real > & by) const
nodiscardconstexpr

Transform by a two-dimensional transformation matrix about the origin.

Parameters
byTransformation matrix to transform by.
Returns
Result.

◆ transform() [3/3]

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::transform ( const Transform3< Real > & by,
Real w = static_cast<Real>(1) ) const
nodiscardconstexpr

Transform by a three-dimensional transformation matrix about the origin.

Parameters
byTransformation matrix to transform by.
wThe homogenous coordinate that defaults to one.
Returns
Result.

◆ transform_at() [1/3]

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::transform_at ( const Vector2< Real > & origin,
const Transform2< Real > & by ) const
nodiscardconstexpr

Transform by a two-dimensional transformation matrix about an origin.

Parameters
originOrigin to transform about.
byTransformation matrix to transform by.
Returns
Result.

◆ transform_at() [2/3]

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::transform_at ( const Vector3< Real > & origin,
const Basis3< Real > & by ) const
nodiscardconstexpr

Transform by a three-dimensional basis matrix about an origin.

Parameters
originOrigin to transform about.
byBasis to transform by.
Returns
Result.

◆ transform_at() [3/3]

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::transform_at ( const Vector3< Real > & origin,
const Transform3< Real > & by,
Real w = static_cast<Real>(1) ) const
nodiscardconstexpr

Transform by a three-dimensional transformation matrix about an origin.

Parameters
originOrigin to transform about.
byTransform matrix to transform by.
wThe homogenous coordinate that defaults to one.
Returns
Result.

◆ translate()

template<typename Real>
Vector3< Real > nnm::Vector3< Real >::translate ( const Vector3< Real > & by) const
nodiscardconstexpr

Translate vector as position.

Parameters
byOffset to translate by.
Returns
Result.

◆ xy()

template<typename Real>
Vector2< Real > nnm::Vector3< Real >::xy ( ) const
inlinenodiscardconstexpr

Two-dimensional vector from the first two components of this vector.

Returns
Result.

◆ zero()

template<typename Real>
constexpr Vector3 nnm::Vector3< Real >::zero ( )
inlinestaticconstexpr

Vector with all components zero.

Returns
Result.

Member Data Documentation

◆ x

template<typename Real>
Real nnm::Vector3< Real >::x

◆ y

template<typename Real>
Real nnm::Vector3< Real >::y

◆ z

template<typename Real>
Real nnm::Vector3< Real >::z

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