MeshLib
 
Loading...
Searching...
No Matches
MR::Vector3< T > Struct Template Reference

#include <MRVector3.h>

Public Types

using ValueType = T
 
using MatrixType = Matrix3<T>
 
using SymMatrixType = SymMatrix3<T>
 

Public Member Functions

constexpr Vector3 () noexcept
 
 Vector3 (NoInit) noexcept
 
constexpr Vector3 (T x, T y, T z) noexcept
 
constexpr Vector3 (const Vector2< T > &v) noexcept
 
template<typename U >
constexpr Vector3 (const Vector3< U > &v) noexcept
 
constexpr const T & operator[] (int e) const noexcept
 
constexpr T & operator[] (int e) noexcept
 
lengthSq () const
 
length () const
 
Vector3 normalized () const
 
Vector3 furthestBasisVector () const
 returns one of 3 basis unit vector that makes the biggest angle with the direction specified by this
 
std::pair< Vector3, Vector3perpendicular () const
 returns 2 unit vector, which together with this vector make an orthogonal basis
 
Vector3 transformed (const AffineXf3< T > *xf) const
 returns this vector transformed by xf if it is
 
void unsignZeroValues ()
 get rid of signed zero values to be sure that equal vectors have identical binary representation
 
bool isFinite () const
 

Static Public Member Functions

static constexpr Vector3 diagonal (T a) noexcept
 
static constexpr Vector3 plusX () noexcept
 
static constexpr Vector3 plusY () noexcept
 
static constexpr Vector3 plusZ () noexcept
 
static constexpr Vector3 minusX () noexcept
 
static constexpr Vector3 minusY () noexcept
 
static constexpr Vector3 minusZ () noexcept
 

Public Attributes

x
 
y
 
z
 

Static Public Attributes

static constexpr int elements = 3
 

Related Symbols

(Note that these are not member symbols.)

template<typename T >
Vector3< T > & operator+= (Vector3< T > &a, const Vector3< T > &b)
 
template<typename T >
Vector3< T > cross (const Vector3< T > &a, const Vector3< T > &b)
 cross product
 
template<typename T >
dot (const Vector3< T > &a, const Vector3< T > &b)
 dot product
 
template<typename T >
mixed (const Vector3< T > &a, const Vector3< T > &b, const Vector3< T > &c)
 mixed product
 
template<typename T >
Vector3< T > mult (const Vector3< T > &a, const Vector3< T > &b)
 per component multiplication
 
template<typename T >
angle (const Vector3< T > &a, const Vector3< T > &b)
 
template<typename T >
Vector3< T > unitVector3 (T azimuth, T altitude)
 returns a point on unit sphere given two angles
 

Detailed Description

template<typename T>
struct MR::Vector3< T >

three-dimensional vector

Member Typedef Documentation

◆ MatrixType

template<typename T >
using MR::Vector3< T >::MatrixType = Matrix3<T>

◆ SymMatrixType

template<typename T >
using MR::Vector3< T >::SymMatrixType = SymMatrix3<T>

◆ ValueType

template<typename T >
using MR::Vector3< T >::ValueType = T

Constructor & Destructor Documentation

◆ Vector3() [1/5]

template<typename T >
constexpr MR::Vector3< T >::Vector3 ( )
inlineconstexprnoexcept

◆ Vector3() [2/5]

template<typename T >
MR::Vector3< T >::Vector3 ( NoInit )
inlineexplicitnoexcept

◆ Vector3() [3/5]

template<typename T >
constexpr MR::Vector3< T >::Vector3 ( T x,
T y,
T z )
inlineconstexprnoexcept

◆ Vector3() [4/5]

template<typename T >
constexpr MR::Vector3< T >::Vector3 ( const Vector2< T > & v)
inlineexplicitconstexprnoexcept

◆ Vector3() [5/5]

template<typename T >
template<typename U >
constexpr MR::Vector3< T >::Vector3 ( const Vector3< U > & v)
inlineexplicitconstexprnoexcept

Member Function Documentation

◆ diagonal()

template<typename T >
static constexpr Vector3 MR::Vector3< T >::diagonal ( T a)
inlinestaticconstexprnoexcept

◆ furthestBasisVector()

template<typename T >
Vector3 MR::Vector3< T >::furthestBasisVector ( ) const

returns one of 3 basis unit vector that makes the biggest angle with the direction specified by this

◆ isFinite()

template<typename T >
bool MR::Vector3< T >::isFinite ( ) const
inline

◆ length()

template<typename T >
T MR::Vector3< T >::length ( ) const
inline

◆ lengthSq()

template<typename T >
T MR::Vector3< T >::lengthSq ( ) const
inline

◆ minusX()

template<typename T >
static constexpr Vector3 MR::Vector3< T >::minusX ( )
inlinestaticconstexprnoexcept

◆ minusY()

template<typename T >
static constexpr Vector3 MR::Vector3< T >::minusY ( )
inlinestaticconstexprnoexcept

◆ minusZ()

template<typename T >
static constexpr Vector3 MR::Vector3< T >::minusZ ( )
inlinestaticconstexprnoexcept

◆ normalized()

template<typename T >
Vector3 MR::Vector3< T >::normalized ( ) const
inline

◆ operator[]() [1/2]

template<typename T >
constexpr const T & MR::Vector3< T >::operator[] ( int e) const
inlineconstexprnoexcept

◆ operator[]() [2/2]

template<typename T >
constexpr T & MR::Vector3< T >::operator[] ( int e)
inlineconstexprnoexcept

◆ perpendicular()

template<typename T >
std::pair< Vector3, Vector3 > MR::Vector3< T >::perpendicular ( ) const

returns 2 unit vector, which together with this vector make an orthogonal basis

◆ plusX()

template<typename T >
static constexpr Vector3 MR::Vector3< T >::plusX ( )
inlinestaticconstexprnoexcept

◆ plusY()

template<typename T >
static constexpr Vector3 MR::Vector3< T >::plusY ( )
inlinestaticconstexprnoexcept

◆ plusZ()

template<typename T >
static constexpr Vector3 MR::Vector3< T >::plusZ ( )
inlinestaticconstexprnoexcept

◆ transformed()

template<typename T >
Vector3 MR::Vector3< T >::transformed ( const AffineXf3< T > * xf) const
inline

returns this vector transformed by xf if it is

◆ unsignZeroValues()

template<typename T >
void MR::Vector3< T >::unsignZeroValues ( )
inline

get rid of signed zero values to be sure that equal vectors have identical binary representation

Friends And Related Symbol Documentation

◆ angle()

template<typename T >
T angle ( const Vector3< T > & a,
const Vector3< T > & b )
related

computes minimal angle in [0,pi] between two vectors; the function is symmetric: angle( a, b ) == angle( b, a )

◆ cross()

template<typename T >
Vector3< T > cross ( const Vector3< T > & a,
const Vector3< T > & b )
related

cross product

◆ dot()

template<typename T >
T dot ( const Vector3< T > & a,
const Vector3< T > & b )
related

dot product

◆ mixed()

template<typename T >
T mixed ( const Vector3< T > & a,
const Vector3< T > & b,
const Vector3< T > & c )
related

mixed product

◆ mult()

template<typename T >
Vector3< T > mult ( const Vector3< T > & a,
const Vector3< T > & b )
related

per component multiplication

◆ operator+=()

template<typename T >
Vector3< T > & operator+= ( Vector3< T > & a,
const Vector3< T > & b )
related

◆ unitVector3()

template<typename T >
Vector3< T > unitVector3 ( T azimuth,
T altitude )
related

returns a point on unit sphere given two angles

Member Data Documentation

◆ elements

template<typename T >
constexpr int MR::Vector3< T >::elements = 3
staticconstexpr

◆ x

template<typename T >
T MR::Vector3< T >::x

◆ y

template<typename T >
T MR::Vector3< T >::y

◆ z

template<typename T >
T MR::Vector3< T >::z

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