GLUS
Functions
glus_math.h File Reference

Go to the source code of this file.

Functions

GLUSAPI GLUSfloat GLUSAPIENTRY glusMathMaxf (const GLUSfloat value0, const GLUSfloat value1)
 Calculates the maximum of two values. More...
 
GLUSAPI GLUSfloat GLUSAPIENTRY glusMathMinf (const GLUSfloat value0, const GLUSfloat value1)
 Calculates the minimum of two values. More...
 
GLUSAPI GLUSfloat GLUSAPIENTRY glusMathRadToDegf (const GLUSfloat radians)
 Converts radians to degrees. More...
 
GLUSAPI GLUSfloat GLUSAPIENTRY glusMathDegToRadf (const GLUSfloat degrees)
 Converts degrees to radians. More...
 
GLUSAPI GLUSfloat GLUSAPIENTRY glusMathMixf (const GLUSfloat value0, const GLUSfloat value1, const GLUSfloat t)
 Linear interpolation of two values. More...
 
GLUSAPI GLUSfloat GLUSAPIENTRY glusMathClampf (const GLUSfloat value, const GLUSfloat min, const GLUSfloat max)
 Clamps a given value between a minimum and maximum value. More...
 
GLUSAPI 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

GLUSAPI 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.
GLUSAPI GLUSfloat GLUSAPIENTRY glusMathDegToRadf ( const GLUSfloat  degrees)

Converts degrees to radians.

Parameters
degreesThe angle in degrees.
Returns
The angle in radians.
GLUSAPI 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.
GLUSAPI 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.
GLUSAPI 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.
GLUSAPI 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.
GLUSAPI GLUSfloat GLUSAPIENTRY glusMathRadToDegf ( const GLUSfloat  radians)

Converts radians to degrees.

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