The following are additional math functions which have been defined
for use in the tcl command expr. Many of them are modeled after
RenderMan shading language functions.
pi
returns the exact value (to 32 bit IEEE precision) value of PI
radians angleInDegrees
returns angleInDegrees converted to units of radians.
degrees angleInRadians
returns angleInRadians converted to units of degrees.
sign arg
returns -1 if arg is negative, 0 if zero, and +1 is arg is positive
min arg1 arg2
returns the minimum of arg1 and arg2
max arg1 arg2
returns the maximum of arg1 and arg2
clamp val min max
returns val clamped between min and max
step min val
returns 0 if val is less than min, otherwise it returns 1
spline u pt1 pt2 pt3 pt4
returns to point along the spline specified by the 4 control pts at u (0<=u<=1) on the curve. Note that for a more flexible spline routine, use the new tcl command spline.
smoothstep min max value
if value is less than min, it returns min, if it's above max, it returns max, otherwise it smoothly interpolates between them
lerpDown u, min, max
if u is less than or equal 0, it returns max, if it's above or equal 1, it returns min, otherwise it smoothly interpolates between them, downwards
lerpUp u, min, max
if u is less than or equal 0, it returns min, if it's above or equal 1, it returns max, otherwise it smoothly interpolates between them, upwards
noise x y z
it returns some value between 0 and 1 which is a pseudorandom function of its argument using Perlin's noise function - see Ch 2 of "Texturing and Modeling: A Procedural Approach" by David Ebert et.al. for more info.
gvnoise x y z
it returns some value between 0 and 1 which is a pseudorandom function of its argument using a gradient value noise function - see Ch 2 of "Texturing and Modeling: A Procedural Approach" by David Ebert et.al. for more info.
scnoise x y z
it returns some value between 0 and 1 which is a pseudorandom function of its argument using a sparse convolution noise function - see Ch 2 of "Texturing and Modeling: A Procedural Approach" by David Ebert et.al. for more info.
vcnoise x y z
it returns some value between 0 and 1 which is a pseudorandom function of its argument using another noise function - see Ch 2 of "Texturing and Modeling: A Procedural Approach" by David Ebert et.al. for more info.