BioDynaMo  v1.03.58-27764645
bdm::Math Struct Reference

`#include <math.h>`

Static Public Member Functions

static real_t GetL2Distance (const Real3 &pos1, const Real3 &pos2)

template<std::size_t N>
static MathArray< real_t, N > CrossProduct (const MathArray< real_t, N > &a, const MathArray< real_t, N > &b)

static Real3 Perp3 (const Real3 &a, real_t random)

static Real3 RotAroundAxis (const Real3 &vector, real_t theta, const Real3 &axis)

static real_t AngleRadian (const Real3 &a, const Real3 &b)

static Real3 ProjectionOnto (const Real3 &a, const Real3 &b)

static real_t MSE (const std::vector< real_t > &v1, const std::vector< real_t > &v2)
Returns the mean squared error between two vectors. More...

Static Public Attributes

static constexpr real_t kPi = static_cast<real_t>(TMath::Pi())
value of pi More...

static constexpr real_t kInfinity = 1e20
Helpful constant to identify 'infinity'. More...

Detailed Description

Definition at line 31 of file math.h.

Member Function Documentation

 static real_t bdm::Math::AngleRadian ( const Real3 & a, const Real3 & b )
inlinestatic

Returns the angle (in radian) between two vectors.

Parameters
 a the first vector b the second vector
Returns
the angle between them.

Definition at line 108 of file math.h.

◆ CrossProduct()

template<std::size_t N>
 static MathArray bdm::Math::CrossProduct ( const MathArray< real_t, N > & a, const MathArray< real_t, N > & b )
inlinestatic

Returns the cross product of two vectors.

Parameters
 a b
Returns
result the cross product of a and b (a x b)

Definition at line 54 of file math.h.

◆ GetL2Distance()

 static real_t bdm::Math::GetL2Distance ( const Real3 & pos1, const Real3 & pos2 )
inlinestatic

Definition at line 41 of file math.h.

◆ MSE()

 static real_t bdm::Math::MSE ( const std::vector< real_t > & v1, const std::vector< real_t > & v2 )
inlinestatic

Returns the mean squared error between two vectors.

Definition at line 122 of file math.h.

◆ Perp3()

 static Real3 bdm::Math::Perp3 ( const Real3 & a, real_t random )
inlinestatic

Returns a vector of norm 1 perpendicular to a 3D vector. As usual there is no length check.

Parameters
 a vector random
Returns
a perpendicular vector

Definition at line 68 of file math.h.

◆ ProjectionOnto()

 static Real3 bdm::Math::ProjectionOnto ( const Real3 & a, const Real3 & b )
inlinestatic

Returns the projection of the first vector onto the second one.

Parameters
 a b
Returns
the projection of a onto b

Definition at line 116 of file math.h.

◆ RotAroundAxis()

 static Real3 bdm::Math::RotAroundAxis ( const Real3 & vector, real_t theta, const Real3 & axis )
inlinestatic

Performs a rotation of a 3D vector `vector` around a given axis `axis`, in the positive mathematical sens.

Parameters
 [in] vector the vector we want to rotate [in] theta the amplitude of rotation (in radian) [in] axis (also a vector)
Returns
the vector after rotation

Definition at line 92 of file math.h.

◆ ToDegree()

 static real_t bdm::Math::ToDegree ( real_t rad )
inlinestatic

Definition at line 37 of file math.h.

 static real_t bdm::Math::ToRadian ( real_t deg )
inlinestatic

Definition at line 38 of file math.h.

◆ kInfinity

 constexpr real_t bdm::Math::kInfinity = 1e20
staticconstexpr

Definition at line 35 of file math.h.

◆ kPi

 constexpr real_t bdm::Math::kPi = static_cast(TMath::Pi())
staticconstexpr

value of pi

Definition at line 33 of file math.h.

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