SpatiumLib
Namespaces | Classes | Functions | Variables
spatium Namespace Reference

Namespaces

 geom2d
 
 geom3d
 
 gfx2d
 
 gfx3d
 
 idx
 
 imgproc
 
 stats
 

Classes

class  Image
 Templated image container. More...
 
class  ImageIO
 Read and write images. More...
 
class  Matrix
 Mathematical matrix with an arbitrary number number of rows and columns. More...
 
struct  PixelValue
 Value of an image pixel with arbitrary data type and channel count. More...
 
struct  PixelValue< T, 1 >
 Value of an image pixel with arbitrary data type and 1 channel. More...
 
struct  PixelValue< T, 3 >
 Value of an image pixel with arbitrary data type and 3 channels. More...
 
struct  PixelValue< T, 4 >
 Value of an image pixel with arbitrary data type and 4 channels. More...
 
class  Vector
 Vector in column-major order. More...
 

Functions

double factorial (int n)
 Calculate the factorial. More...
 
double binomialCoefficient (int n, int k)
 Calculate the binomial coefficient. More...
 
int solveQuadratic (double a, double b, double c, double &x1, double &x2)
 Solve a quadratic equation: ax^2 + bx + c = 0. More...
 
int solveCubic (double a, double b, double c, double d, double &x1, double &x2, double &x3)
 Solve a qubic equation: ax^3 + bx^2 + cx + d =0. More...
 

Variables

const double PI = std::atan(1) * 4
 Pi constant. More...
 
const double Rad2Deg = 180 / PI
 Radians to degrees conversion constant. More...
 
const double Deg2Rad = PI / 180
 Degrees to radians conversion constant. More...
 

Function Documentation

◆ binomialCoefficient()

double spatium::binomialCoefficient ( int  n,
int  k 
)
inline

Calculate the binomial coefficient.

Combinatorics: Choose a subset of K elements from a fixed set of N elements. 'N choose K'

Parameters
[in]nNumber of elements in fixed set
[in]kNumber of elements to choose
Returns
Binomial coefficient

◆ factorial()

double spatium::factorial ( int  n)
inline

Calculate the factorial.

Example: factorial(4) = 4! = 4*3*2*1 = 24

Parameters
[in]nA positive integer
Returns
Factorial

◆ solveCubic()

int spatium::solveCubic ( double  a,
double  b,
double  c,
double  d,
double &  x1,
double &  x2,
double &  x3 
)
inline

Solve a qubic equation: ax^3 + bx^2 + cx + d =0.

Parameters
[in]aFirst coefficient
[in]bSecond coefficient
[in]cThird coefficient
[in]dFourth coefficient
[out]x1First solution (if exists). Lowest value
[out]x2Second solution (if exists).
[out]x3Third solution (if exists). Highest value
Returns
Number of solutions 1, 2 or 3

◆ solveQuadratic()

int spatium::solveQuadratic ( double  a,
double  b,
double  c,
double &  x1,
double &  x2 
)
inline

Solve a quadratic equation: ax^2 + bx + c = 0.

Parameters
[in]aFirst coefficient
[in]bSecond coefficient
[in]cThird coefficient
[out]x1First solution (if exists). Lowest value
[out]x2Second solution (if exists). Highest value
Returns
Number of unique solutions 0, 1 or 2

Variable Documentation

◆ Deg2Rad

const double spatium::Deg2Rad = PI / 180

Degrees to radians conversion constant.

◆ PI

const double spatium::PI = std::atan(1) * 4

Pi constant.

◆ Rad2Deg

const double spatium::Rad2Deg = 180 / PI

Radians to degrees conversion constant.