Mathematical Functions in VEX
![图片[1]-Houdini常用表达式函数-houdiniUE](http://www.houdiue.cn/wp-content/uploads/2025/11/image-172-1024x490.png)
Each formula along with some of the characteristics are listed below.
y = 0; // Constant (value remains the same at all points in time)
y = x; // Linear (value changes at a constant rate over time)
y = pow(2,x); // Exponential, these functions grow very rapidly. y = pow(M_E, x); y = exp(x);
y = pow(x,2); // Quadratic, same as: y = x*x;
y = pow(x,3); // Cubic, same as: y = x*x*x;
y = 1.0/x; // Reciprocal, with x in the denominator this will produce asymptotes at the axis
y = log(x); // Logarithmic, rate of growth diminishes over time
y = sqrt(x); // Square Root, same as: y = pow(x,0.5);
Mathematical Constants
The following constants are defined in $HFS/houdini/vex/include/math.h and automatically included in all VEX wrangle snippets.
M_E 2.7182818 // sometimes called the natural number, or Euler's number
LN10 2.3025850 // natural logarithm of 10
LN2 0.6931471 // natural logarithm of 2
LOG10E 0.4342944
LOG2E 1.4426950
PI 3.1415926 // 180° in radians, the ratio of the circumference to diameter of a circle
M_TWO_PI 6.2831852 // 360° in radians, the circumference of a unit circle, 2 * PI
PI_2 1.5707963 // 90° in radians, 1/4th of the circumference of a unit circle, PI / 2
PI_4 0.7853981 // 45° in radians, 1/8th of the circumference of a unit circle, PI / 4
SQRT1_2 0.7071067
SQRT2 1.4142135
TOLERANCE 0.0001
some curves produced using standard math/VEX functions.
sin wave square wave triangle wave clamp floor frac abs smoothstep
Strings in VEX
abspath() -- Returns the full path of a file.
chr() -- Converts a Unicode codepoint to a UTF8 string.
concat() -- Concatenates all the specified strings into a single string.
decode() -- Decodes a variable name that was previously encoded.
decodeattrib() -- Decodes a geometry attribute name that was previously encoded.
decodeparm() -- Decodes a node parameter name that was previously encoded.
decodeutf8() -- Decodes a UTF8 string into a series of codepoints.
encode() -- Encodes any string into a valid variable name.
encodeattrib() -- Encodes any string into a valid geometry attribute name.
encodeparm() -- Encodes any string into a valid node parameter name.
encodeutf8() -- Encodes a UTF8 string from a series of codepoints.
endswith() -- Indicates if the string ends with the specified string.
find() -- Finds an item in an array or string.
isalpha() -- Returns 1 if all characters in the string are alphabetic.
isdigit() -- Returns 1 if all characters in the string are numeric.
itoa() -- Converts an integer to a string.
join() -- Concatenates all strings of an array, inserting a common spacer.
lstrip() -- Strips leading whitespace from a string.
makevalidvarname() -- Forces a string to conform to the rules for variable names.
match() -- Returns 1 if the subject matches the pattern specified, or 0 if it doesn’t.
opdigits() -- Returns the integer value of the last sequence of digits of a string.
ord() -- Converts a UTF8 string into a codepoint.
pluralize() -- Converts an English noun to its plural.
re_find() -- Matches a regular expression in a string.
re_findall() -- Finds all instances of the given regular expression in the string.
re_match() -- Returns 1 if the entire input string matches the expression.
re_replace() -- Replaces instances of regex_find with regex_replace.
re_split() -- Splits the given string based on regex match.
relativepath() -- Computes the relative path for two full paths.
relpath() -- Returns the relative path to a file.
replace() -- Replaces occurrences of a substring.
replace_match() -- Replaces the matched string pattern with another pattern.
rstrip() -- Strips trailing whitespace from a string.
split() -- Splits a string into tokens.
splitpath() -- Splits a file path into the directory and name parts.
sprintf() -- Formats a string like printf but returns the result as a string instead of printing it.
startswith() -- Returns 1 if the string starts with the specified string.
strip() -- Strips leading and trailing whitespace from a string.
strlen() -- Returns the length of the string.
titlecase() -- Returns a string that is the titlecase version of the input string.
tolower() -- Converts all characters in a string to lower case.
toupper() -- Converts all characters in a string to upper case.
![图片[2]-Houdini常用表达式函数-houdiniUE](http://www.houdiue.cn/wp-content/uploads/2025/11/07-118x1024.jpg)
276错误 输出?
![图片[3]-Houdini常用表达式函数-houdiniUE](http://www.houdiue.cn/wp-content/uploads/2025/11/09-121x1024.jpg)
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END








暂无评论内容