26template <
typename Scalar>
29 return Scalar(180) * rad / Scalar(M_PI);
34template <
typename Scalar>
37 return Scalar(M_PI) * deg / Scalar(180);
45 return (T(0) < val) - (val < T(0));
49template <
typename Scalar>
50Scalar
gaussian(Scalar x, Scalar sigma, Scalar center = 0)
52 Scalar x2 = (x - center) * (x - center);
53 Scalar exponent = x2 / (2 * sigma * sigma);
54 return std::exp(-exponent);
Main namespace for Lagrange.
Definition: AABBIGL.h:30
Scalar to_radians(Scalar deg=1)
Convert degrees to radians.
Definition: utils.h:35
Scalar to_degrees(Scalar rad=1)
Convert radians to degrees.
Definition: utils.h:27
int sign(T val)
Get the sign of the value Returns either -1, 0, or 1.
Definition: utils.h:43
Scalar gaussian(Scalar x, Scalar sigma, Scalar center=0)
Simple evaluation of Gaussian function.
Definition: utils.h:50