data_math
Synopsis
perform mathematical operations on fields using V expressions
Input Port
in_field1
|
Mesh + Node_Data
|
in_field2
|
Mesh + Node_Data
|
in_field3
|
Mesh + Node_Data
|
in_field4
|
Mesh + Node_Data
|
ui_parent
|
user interface parent object
|
Parameters
Operation
|
UItext
|
expression to evaluate
|
data type
|
UIradioBoxLabel
|
data type for computation & output
|
Output Port
out_fld
|
same Mesh + Node_Data
|
out_obj
|
output renderable object
|
Description
data_math performs mathematical operations on one to four input fields. You type in any valid V expression, and use the OutDataType selection box to pick the data type for the result.
Input
in_fieldn
The input field(s) must be a field with any type of mesh and Node_Data. You can use from 1 to 4 inputs. When typing the expression, you refer to them as #1, #2, #3, and #4.
data_math uses the first (0th) component of each field. Operations between two fields require that their components be the same length (nnodes must be equal) and both components have the same veclen.
ui_parent
A port to connect to a user interface object that contains the macro's widgets. By default, it is connected to the default user interface object in the application in which the macro is instanced. (This default connection is not drawn.)
Parameters
Operation
UItext. Any valid V mathematical expression. Do not enclose in quotes or terminate with a semi-colon (that is, ";"). The following expression calculates the vector magnitude of the 0th component of input fields 1, 2, and 3 (treating the combination of those three fields as a vector):
sqrt(pow(#1,2) + pow(#2,2) + pow(#3,2))
data type
UIradioBoxLabel. Radio buttons to set the data type in which the computation will be performed. Each input's 0th component Node_Data is first converted to that type, the computation is performed in that type, and the output Node_Data is in that type. The choices are char, byte, short, int, float, and double. The default is float.
Output Port
out_fld
The output field contains a new Node_Data that has the result of the computation. Its mesh is a reference to the input mesh of in_field1.
out_obj
This is a renderable version of the output field.
Example
Not available
File
v/modules.v
See also
For more information on expressions, see the section on value expressions in the Using AVS/Express manual.