EBGeometry  1.0
Classes | Functions
EBGeometry_Vec.hpp File Reference

Declaration of 2D and 3D point/vector classes with templated precision. Used with DCEL tools. More...

#include <array>
#include <iostream>
#include "EBGeometry_NamespaceHeader.hpp"
#include "EBGeometry_NamespaceFooter.hpp"
#include "EBGeometry_VecImplem.hpp"
Include dependency graph for EBGeometry_Vec.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Vec2T< T >
 Two-dimensional vector class with arithmetic operators. More...
 
class  Vec3T< T >
 Three-dimensional vector class with arithmetic operators. More...
 

Functions

template<typename T >
constexpr Vec2T< T > operator* (const T &s, const Vec2T< T > &a_other) noexcept
 Multiplication operator in the form s*Vec2T. More...
 
template<typename T >
constexpr Vec2T< T > operator/ (const T &s, const Vec2T< T > &a_other) noexcept
 Division operator in the form s*Vec2T. More...
 
template<typename T >
Vec2T< T > min (const Vec2T< T > &u, const Vec2T< T > &v) noexcept
 Minimum function. Returns new vector with component-wise minimums. More...
 
template<typename T >
Vec2T< T > max (const Vec2T< T > &u, const Vec2T< T > &v) noexcept
 Maximum function. Returns new vector with component-wise minimums. More...
 
template<typename T >
dot (const Vec2T< T > &u, const Vec2T< T > &v) noexcept
 Dot product function. More...
 
template<typename T >
length (const Vec2T< T > &v) noexcept
 Length function. More...
 
template<class R , typename T >
constexpr Vec3T< T > operator* (const R &s, const Vec3T< T > &u) noexcept
 Multiplication operator. More...
 
template<typename T >
constexpr Vec3T< T > operator* (const Vec3T< T > &u, const Vec3T< T > &v) noexcept
 Multiplication operator. More...
 
template<class R , typename T >
constexpr Vec3T< T > operator/ (const R &s, const Vec3T< T > &u) noexcept
 Division operator. More...
 
template<typename T >
constexpr Vec3T< T > min (const Vec3T< T > &u, const Vec3T< T > &v) noexcept
 Minimum function. Returns new vector with component-wise minimums. More...
 
template<typename T >
constexpr Vec3T< T > max (const Vec3T< T > &u, const Vec3T< T > &v) noexcept
 Maximum function. Returns new vector with component-wise minimums. More...
 
template<typename T >
constexpr T dot (const Vec3T< T > &u, const Vec3T< T > &v) noexcept
 Dot product function. More...
 
template<typename T >
constexpr T length (const Vec3T< T > &v) noexcept
 Length function. More...
 

Detailed Description

Declaration of 2D and 3D point/vector classes with templated precision. Used with DCEL tools.

Author
Robert Marskar

Function Documentation

◆ dot() [1/2]

template<typename T >
T dot ( const Vec2T< T > &  u,
const Vec2T< T > &  v 
)
inlinenoexcept

Dot product function.

Parameters
[in]uVector
[in]vOther vector

◆ dot() [2/2]

template<typename T >
constexpr T dot ( const Vec3T< T > &  u,
const Vec3T< T > &  v 
)
inlineconstexprnoexcept

Dot product function.

Parameters
[in]uVector
[in]vOther vector

◆ length() [1/2]

template<typename T >
T length ( const Vec2T< T > &  v)
inlinenoexcept

Length function.

Parameters
[in]vVector.

◆ length() [2/2]

template<typename T >
constexpr T length ( const Vec3T< T > &  v)
inlineconstexprnoexcept

Length function.

Parameters
[in]vVector.

◆ max() [1/2]

template<typename T >
Vec2T<T> max ( const Vec2T< T > &  u,
const Vec2T< T > &  v 
)
inlinenoexcept

Maximum function. Returns new vector with component-wise minimums.

Parameters
[in]uVector
[in]vOther vector
Returns
Returns new vector with components x = std::max(u.x, v.x).

◆ max() [2/2]

template<typename T >
constexpr Vec3T<T> max ( const Vec3T< T > &  u,
const Vec3T< T > &  v 
)
inlineconstexprnoexcept

Maximum function. Returns new vector with component-wise minimums.

Parameters
[in]uVector
[in]vOther vector
Returns
Returns new vector with components X[0] = std::max(u.X[0], v.X[0]) and so on

◆ min() [1/2]

template<typename T >
Vec2T<T> min ( const Vec2T< T > &  u,
const Vec2T< T > &  v 
)
inlinenoexcept

Minimum function. Returns new vector with component-wise minimums.

Parameters
[in]uVector
[in]vOther vector
Returns
Returns new vector with components x = std::min(u.x, v.x).

◆ min() [2/2]

template<typename T >
constexpr Vec3T<T> min ( const Vec3T< T > &  u,
const Vec3T< T > &  v 
)
inlineconstexprnoexcept

Minimum function. Returns new vector with component-wise minimums.

Parameters
[in]uVector
[in]vOther vector
Returns
Returns new vector with components X[0] = std::min(u.X[0], v.X[0]) and so on

◆ operator*() [1/3]

template<class R , typename T >
constexpr Vec3T<T> operator* ( const R &  s,
const Vec3T< T > &  u 
)
inlineconstexprnoexcept

Multiplication operator.

Parameters
[in]sMultiplication scalar
[in]uVector
Returns
Returns new vector with components X[0] = s*X[0] and so on.

◆ operator*() [2/3]

template<typename T >
constexpr Vec2T<T> operator* ( const T &  s,
const Vec2T< T > &  a_other 
)
inlineconstexprnoexcept

Multiplication operator in the form s*Vec2T.

Parameters
[in]sMultiplication factor
[in]a_otherOther vector
Returns
Returns a new vector with components x = s*a_other.x (and same for y)

◆ operator*() [3/3]

template<typename T >
constexpr Vec3T<T> operator* ( const Vec3T< T > &  u,
const Vec3T< T > &  v 
)
inlineconstexprnoexcept

Multiplication operator.

Parameters
[in]uOne vector
[in]vOther vector
Returns
Returns new vector with components X[0] = u[0]*[v0] and so on

◆ operator/() [1/2]

template<class R , typename T >
constexpr Vec3T<T> operator/ ( const R &  s,
const Vec3T< T > &  u 
)
inlineconstexprnoexcept

Division operator.

Parameters
[in]sDivision scalar
[in]uVector
Returns
Returns new vector with components X[0] = X[0]/s and so on.

◆ operator/() [2/2]

template<typename T >
constexpr Vec2T<T> operator/ ( const T &  s,
const Vec2T< T > &  a_other 
)
inlineconstexprnoexcept

Division operator in the form s*Vec2T.

Parameters
[in]sDivision factor
[in]a_otherOther vector
Returns
Returns a new vector with components x = (1/s)*a_other.x (and same for y)