Mathematical Functions

A number of internal functions (which are otherwise typically not used in breve simulations) are available for math-related expressions. Internal functions are called just like C functions: functionName (arguments).

  • sin(input) gives the sine of the radian angle input.

  • cos(input) gives the cosine of the radian angle input.

  • tan(input) gives the tangent of the radian angle input.

  • asin(input) gives the radian angle arc sine of input.

  • acos(input) gives the radian angle arc cosine of the input.

  • atan(input) gives the radian angle arc tangent of input.

  • sqrt(input) gives the float square root of input.

  • angle(a, b) gives the float angle in radians between vectors a and b.

  • max(a, b) gives the maximum of floats a and b.

  • min(a, b) gives the minimum of floats a and b.

  • cross(v1, v2) gives the vector cross product of vectors v1 and v2.

  • dot(v1, v2) gives the float dot product of vectors v1 and v2.

  • log(input) gives the float natural log of input.

  • randomGauss() gives a float random number with a Gaussian distribution.

  • transpose(input) gives the transpose of the matrix input.

The following internal functions are used for testing float variables for special values which have meaning primarily to developers and plugin authors.

  • isnan(input) returns 1 if the input is a "not-a-number" float value, 0 otherwise.

  • isinf(input) returns 1 if the input is a float value representing infinity, 0 otherwise.