4.7.2 Math functions

abs( x)
Returns the absolute value of its argument. This is just the builtin abs() function.

acos( a)
Returns the arc cosine. This function is imported from the math module.

asin( a)
Returns the arc sine. This function is imported from the math module.

atan( y[, x])
Returns the arc tangent. With one argument math.atan() is called, with two arguments math.atan2() is called.

ceil( x)
Returns the largest integer not greater than x. This function is imported from the math module.

clamp( x, min, max)
Returns min if x < min, max if x > max, otherwise x.

color_cellnoise( p)
Returns a color value (actually a vec3) whose value is a (pseudo) random function of its arguments. The return value is constant between integer lattice points.

color_noise( p)
Returns a color value (actually a vec3) whose value is a (pseudo) random function of its arguments.

color_pnoise( p, period)
Returns a color value (actually a vec3) whose value is a periodic (pseudo) random function of its arguments.

color_random( )
Return a color whose componenets are a random number between 0 and 1. The function actually returns a vec3.

cos( a)
Returns the cosine. This function is imported from the math module.

degrees( rad)
Converts from radians to degrees.

exp( x)
Returns pow(e,x). This function is imported from the math module.

float_cellnoise( p)
Returns a float value which is a (pseudo) random function of its arguments. The return value is constant between integer lattice points. This function is imported from the noise module.

float_noise( p)
Returns a float value which is a (pseudo) random function of its arguments. This function is imported from the noise module.

float_pnoise( p, period)
Returns a float value which is a periodic (pseudo) random function of its arguments. This function is imported from the noise module.

float_random( )
Return a random number between 0 and 1. This call is equivalent to random.random().

floor( x)
Returns the smallest integer not smaller than x. This function is imported from the math module.

inversesqrt( x)
Returns 1/sqrt(x).

log( x[, base])
Returns the natural logarithm of x (the same as math.log) or the logarithm to the specified base.

max( a, b, ...)
Returns the argument with maximum value. This is just the builtin max() function.

min( a, b, ...)
Returns the argument with minimum value. This is just the builtin min() function.

mix( val0, val1, t)
For t=0 the value val0 is returned, for t=1 the value val1 is returned. For values of t between 0 and 1 a linearly interpolated value is returned.

mod( a, b)
Returns a%b. This is just an equivalent for the %-operator.

point_cellnoise( p)
Returns a point (as a vec3) whose value is a (pseudo) random function of its arguments. The return value is constant between integer lattice points.

point_noise( p)
Returns a point (as a vec3) whose value is a (pseudo) random function of its arguments.

point_pnoise( p, period)
Returns a point (as a vec3) whose value is a periodic (pseudo) random function of its arguments.

point_random( )
Return a point (a vec3) whose componenets are a random number between 0 and 1.

pow( x, y)
Returns x**y. This function is imported from the math module.

radians( deg)
Converts from degrees to radians.

round( deg)
Returns the integer closest to x. This is just the builtin round() function.

sign( x)
Returns -1 with a negative argument, +1 with a positive argument, and 0 if its argument is zero.

sin( a)
Returns the sine. This function is imported from the math module.

smoothstep( min, max, value)
Returns 0 if value < min, 1 if value > max, and performs a smooth Hermite interpolation between 0 and 1 in the interval min to max.

spline( t, controlpoints)
Fits a spline to the control points given and returns the value at t which ranges from 0 to 1. At least four control points must always be given.

sqrt( x)
Returns the square root. This function is imported from the math module.

step( min, x)
Returns 0 if x < min, otherwise 1.

tan( a)
Returns the tangent. This function is imported from the math module.

tan( a)
Returns the tangent. This function is imported from the math module.

vector_cellnoise( p)
Returns a vector (as a vec3) whose value is a (pseudo) random function of its arguments. The return value is constant between integer lattice points.

vector_noise( p)
Returns a vector (as a vec3) whose value is a (pseudo) random function of its arguments.

vector_pnoise( p, period)
Returns a vector (as a vec3) whose value is a periodic (pseudo) random function of its arguments.