#include <MyMath.h>
|
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 const double | PI = 3.14159 |
|
Utility class for mathematical operations.
double util::MyMath::Clamp |
( |
double |
min, |
|
|
double |
max, |
|
|
double |
value |
|
) |
| |
|
static |
Clamps the value between min and max, both inclusive.
- Parameters
-
min | The minimum value |
max | The maximum value |
value | The 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
-
a | The first point in 3D space |
b | The 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
-
a | The first point in 2D space |
b | The 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
-
a | The first value |
b | The second value |
value | The 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
-
a | The first value |
b | The second value |
value | The interpolation value |
- Returns
- The interpolated value
double util::MyMath::Radian |
( |
double |
degree | ) |
|
|
static |
Calculates the radian value of the given degree value.
- Parameters
-
degree | The arc value in degree |
- Returns
- The arc value in radian
The documentation for this class was generated from the following files: