Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Static Public Member Functions | List of all members
CDPL::Math::VectorAngleCosine< V1, V2, T > Struct Template Reference

Functor returning the cosine of the angle between two vectors (optionally clamped to [-1, 1]). More...

#include <Functional.hpp>

+ Inheritance diagram for CDPL::Math::VectorAngleCosine< V1, V2, T >:

Public Types

typedef CommonType< typename VectorInnerProduct< V1, V2 >::ResultType, T >::Type ResultType
 
- Public Types inherited from CDPL::Math::VectorScalarBinaryFunctor< V1, V2 >
typedef CommonType< typename V1::ValueType, typename V2::ValueType >::Type ResultType
 The scalar result type (common type of the two vector element types). More...
 

Static Public Member Functions

static ResultType apply (const VectorExpression< V1 > &e1, const VectorExpression< V2 > &e2, const T &sd, bool clamp)
 Returns the cosine of the angle between e1 and e2. More...
 

Detailed Description

template<typename V1, typename V2, typename T>
struct CDPL::Math::VectorAngleCosine< V1, V2, T >

Functor returning the cosine of the angle between two vectors (optionally clamped to [-1, 1]).

Template Parameters
V1The first vector expression type.
V2The second vector expression type.
TThe norm-product scalar type.

Member Typedef Documentation

◆ ResultType

template<typename V1 , typename V2 , typename T >
typedef CommonType<typename VectorInnerProduct<V1, V2>::ResultType, T>::Type CDPL::Math::VectorAngleCosine< V1, V2, T >::ResultType

Member Function Documentation

◆ apply()

template<typename V1 , typename V2 , typename T >
static ResultType CDPL::Math::VectorAngleCosine< V1, V2, T >::apply ( const VectorExpression< V1 > &  e1,
const VectorExpression< V2 > &  e2,
const T &  sd,
bool  clamp 
)
inlinestatic

Returns the cosine of the angle between e1 and e2.

Parameters
e1The first vector expression.
e2The second vector expression.
sdThe precomputed product \( \|e_1\| \cdot \|e_2\| \) of the two vector magnitudes.
clampIf true, the result is clamped to the range [-1, 1].
Returns
The (optionally clamped) cosine of the angle.

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