This object offers a wide collection of mathematical formulas and functions, including the following
(the first input is denoted as p1, the second as p2, etc.):
- abs. value - absolute value, inverts sign of negative values
- add - addition of two channels
- arc cos - usual trigonometric inverse functions
- arc cot
- arc sin
- arc tan
- ceiling - rounding up to integer value
- cross product - computes cross product of inputs, the result is perpendicular to both
- divide - p1/p2
- dot product - (x1, y1, z1) dot product (x2, y2, z2) = (x1*x2, y1*y2, z1*z2)
- exponent - exp(p1)
- faceforward - computes a vector which is parallel to p1 and faces against p2.
In other words: v=faceforward(unit_normal, ray) means that v dot unit_normal = +-1 and v dot ray is less than 0.
- floor - rounding down to integer value
- invert - 1/p1
- length - the length of the input vector = square_root(x*x + y*y + z*z)
- logarithm - natural logarithm
- max - maximum(p1, p2)
- min - output = minimum(p1, p2)
- modulo - p1%p2 (floating point modulo)
- modulo by 1 - p1%1, the decimal part of p1
- multiply - p1*p2
- negate - -p1
- normalize - (x, y, z) - (x, y, z)/squareroot(x*x + y*y + z+z)
- polar - transforms cartesian coordinates to polar coordinates (heading, pitch, distance)
- power - p1 to the power of p2
- reflect - reflects a ray p1 with respect to a unit normal vector p2.
- refract - computes light refraction refracted ray=refract(exterior thickness, interior thickness, incoming ray, surface normal)
- round - rounding to the nearest integer
- sign - -1 if parameter is negative, 0 if zero, +1 if positive.
- sqrt - square root
- subtract - p1-p2
- 1-(1-p1)(1-p2) - some useful formulas
(1-p1)*p2+p1*p3 - linear interpolation
(p1+p2)/2 - average of input channels
(x,y,z)-(x+y+z)/3 - sub channel average. Can be used in color to gray scale conversion, etc.