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
 
auto length () const
 
Vector3 normalized () const MR_REQUIRES_IF_SUPPORTED(std
 
Vector3 furthestBasisVector() const MR_REQUIRES_IF_SUPPORTED(!std std::pair< Vector3, Vector3 > perpendicular() const MR_REQUIRES_IF_SUPPORTED(std Vector3 transformed (const AffineXf3< T > *xf) const MR_REQUIRES_IF_SUPPORTED(!std
 returns one of 3 basis unit vector that makes the biggest angle with the direction specified by this
 
void unsignZeroValues () MR_REQUIRES_IF_SUPPORTED(std
 get rid of signed zero values to be sure that equal vectors have identical binary representation
 
bool isFinite () const MR_REQUIRES_IF_SUPPORTED(std
 

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 >
sqr (const Vector3< T > &a)
 squared length
 
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 >
Vector3< T > div (const Vector3< T > &a, const Vector3< T > &b)
 per component division
 
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 >
MR::Vector3< T >::Vector3 ( )
inlineconstexprnoexcept

◆ Vector3() [2/5]

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

◆ Vector3() [3/5]

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

◆ Vector3() [4/5]

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

◆ Vector3() [5/5]

template<typename T >
template<typename U >
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

◆ isFinite()

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

◆ length()

template<typename T >
auto 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
inlinenodiscard

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

◆ 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 furthestBasisVector() const MR_REQUIRES_IF_SUPPORTED(!std std::pair< Vector3, Vector3 > perpendicular() const MR_REQUIRES_IF_SUPPORTED(std Vector3 MR::Vector3< T >::transformed ( const AffineXf3< T > * xf) const
inline

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

returns 2 unit vector, which together with this vector make an orthogonal basis Currently not implemented for integral vectors. 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

◆ div()

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

per component division

◆ 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

◆ sqr()

template<typename T >
T sqr ( const Vector3< T > & a)
related

squared length

◆ 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 >
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 files: