Tracore
Static Public Member Functions | Static Public Attributes | List of all members
util::MyMath Class Reference

#include <MyMath.h>

Static Public Member Functions

static double Clamp (double min, double max, double value)
 
static double Lerp (double a, double b, double value)
 
static double InverseLerp (double a, double b, double value)
 
static double EuclideanDistance (cv::Point3d a, cv::Point3d b)
 
static double EuclideanDistance (cv::Point2d a, cv::Point2d b)
 
static double Radian (double degree)
 

Static Public Attributes

static const double PI = 3.14159
 

Detailed Description

Utility class for mathematical operations.

Member Function Documentation

double util::MyMath::Clamp ( double  min,
double  max,
double  value 
)
static

Clamps the value between min and max, both inclusive.

Parameters
minThe minimum value
maxThe maximum value
valueThe value to clamp
Returns
The clamped value
double util::MyMath::EuclideanDistance ( cv::Point3d  a,
cv::Point3d  b 
)
static

Calculates the euclidean distance of the given points.

Parameters
aThe first point in 3D space
bThe second point in 3D space
Returns
The euclidean distance
double util::MyMath::EuclideanDistance ( cv::Point2d  a,
cv::Point2d  b 
)
static

Calculates the euclidean distance of the given points.

Parameters
aThe first point in 2D space
bThe second point in 2D space
Returns
The euclidean distance
double util::MyMath::InverseLerp ( double  a,
double  b,
double  value 
)
static

Inverse linearly interpolates between a and b at value.

Parameters
aThe first value
bThe second value
valueThe value to get the interpolation of
Returns
The interpolation value
double util::MyMath::Lerp ( double  a,
double  b,
double  value 
)
static

Linearly interpolates between a and b at value.

Parameters
aThe first value
bThe second value
valueThe interpolation value
Returns
The interpolated value
double util::MyMath::Radian ( double  degree)
static

Calculates the radian value of the given degree value.

Parameters
degreeThe arc value in degree
Returns
The arc value in radian

The documentation for this class was generated from the following files: