GLUS
Functions
glus_math.c File Reference
#include "GL/glus.h"

Functions

GLUSfloat GLUSAPIENTRY glusMathMaxf (const GLUSfloat value0, const GLUSfloat value1)
 Calculates the maximum of two values. More...
 
GLUSfloat GLUSAPIENTRY glusMathMinf (const GLUSfloat value0, const GLUSfloat value1)
 Calculates the minimum of two values. More...
 
GLUSfloat GLUSAPIENTRY glusMathRadToDegf (const GLUSfloat radians)
 Converts radians to degrees. More...
 
GLUSfloat GLUSAPIENTRY glusMathDegToRadf (const GLUSfloat degrees)
 Converts degrees to radians. More...
 
GLUSfloat GLUSAPIENTRY glusMathMixf (const GLUSfloat value0, const GLUSfloat value1, const GLUSfloat t)
 Linear interpolation of two values. More...
 
GLUSfloat GLUSAPIENTRY glusMathClampf (const GLUSfloat value, const GLUSfloat min, const GLUSfloat max)
 Clamps a given value between a minimum and maximum value. More...
 
GLUSfloat GLUSAPIENTRY glusMathLengthf (const GLUSfloat x, const GLUSfloat y, const GLUSfloat z)
 Calculates the length of a vector or the distance of a point to the origin by providing the x, y and z coordinates. More...
 

Function Documentation

GLUSfloat GLUSAPIENTRY glusMathClampf ( const GLUSfloat  value,
const GLUSfloat  min,
const GLUSfloat  max 
)

Clamps a given value between a minimum and maximum value.

If the value is between min and max, the value is returned.

Parameters
valueThe value to be clamped.
minThe minimum border. If the value is lower than min, min is returned.
maxThe maximum border. If the value is greater than max, max is returned.
Returns
The clamped value.
GLUSfloat GLUSAPIENTRY glusMathDegToRadf ( const GLUSfloat  degrees)

Converts degrees to radians.

Parameters
degreesThe angle in degrees.
Returns
The angle in radians.
GLUSfloat GLUSAPIENTRY glusMathLengthf ( const GLUSfloat  x,
const GLUSfloat  y,
const GLUSfloat  z 
)

Calculates the length of a vector or the distance of a point to the origin by providing the x, y and z coordinates.

Parameters
xThe x coordinate.
yThe y coordinate.
zThe z coordinate.
Returns
The calculated length.
GLUSfloat GLUSAPIENTRY glusMathMaxf ( const GLUSfloat  value0,
const GLUSfloat  value1 
)

Calculates the maximum of two values.

Parameters
value0The first value.
value1The second value.
Returns
The maximum of the two values.
GLUSfloat GLUSAPIENTRY glusMathMinf ( const GLUSfloat  value0,
const GLUSfloat  value1 
)

Calculates the minimum of two values.

Parameters
value0The first value.
value1The second value.
Returns
The minimum of the two values.
GLUSfloat GLUSAPIENTRY glusMathMixf ( const GLUSfloat  value0,
const GLUSfloat  value1,
const GLUSfloat  t 
)

Linear interpolation of two values.

If t = 0, value0 is returned. If t = 1, value1 is returned.

Parameters
value0First value.
value1Second value.
tThe fraction.
Returns
The interpolated value.
GLUSfloat GLUSAPIENTRY glusMathRadToDegf ( const GLUSfloat  radians)

Converts radians to degrees.

Parameters
radiansThe angle in radians.
Returns
The angle in degrees.