Calculator (Calculator)
Compute new attribute arrays as function of existing arrays.
The Calculator filter computes a new data array or new point coordinates as a function of existing scalar or vector arrays. If point-centered arrays are used in the computation of a new data array, the resulting array will also be point-centered. Similarly, computations using cell-centered arrays will produce a new cell-centered array. If the function is computing point coordinates, the result of the function must be a three-component vector. The Calculator interface operates similarly to a scientific calculator. In creating the function to evaluate, the standard order of operations applies.
Each of the calculator functions is described below. Unless otherwise noted, enclose the operand in parentheses using the ( and ) buttons.
Clear: Erase the current function (displayed in the read-only text box above the calculator buttons).
/: Divide one scalar by another. The operands for this function are not required to be enclosed in parentheses.
*: Multiply two scalars, or multiply a vector by a scalar (scalar multiple). The operands for this function are not required to be enclosed in parentheses.
-: Negate a scalar or vector (unary minus), or subtract one scalar or vector from another. The operands for this function are not required to be enclosed in parentheses.
+: Add two scalars or two vectors. The operands for this function are not required to be enclosed in parentheses.
sin: Compute the sine of a scalar.
cos: Compute the cosine of a scalar.
tan: Compute the tangent of a scalar.
asin: Compute the arcsine of a scalar.
acos: Compute the arccosine of a scalar.
atan: Compute the arctangent of a scalar.
sinh: Compute the hyperbolic sine of a scalar.
cosh: Compute the hyperbolic cosine of a scalar.
tanh: Compute the hyperbolic tangent of a scalar.
x^y: Raise one scalar to the power of another scalar. The operands for this function are not required to be enclosed in parentheses.
sqrt: Compute the square root of a scalar.
e^x: Raise e to the power of a scalar.
log: Compute the logarithm of a scalar.
ceil: Compute the ceiling of a scalar.
floor: Compute the floor of a scalar.
abs: Compute the absolute value of a scalar.
v1.v2: Compute the dot product of two vectors. The operands for this function are not required to be enclosed in parentheses.
mag: Compute the magnitude of a vector.
norm: Normalize a vector.
The operands are described below.
The digits 0 - 9 and the decimal point are used to enter constant scalar values.
iHat, jHat, and kHat are vector constants representing unit vectors in the X, Y, and Z directions, respectively.
The scalars menu lists the names of the scalar arrays and the components of the vector arrays of either the point-centered or cell-centered data. The vectors menu lists the names of the point-centered or cell-centered vector arrays. The function will be computed for each point (or cell) using the scalar or vector value of the array at that point (or cell).
The filter operates on any type of data set, but the input data set must have at least one scalar or vector array. The arrays can be either point-centered or cell-centered. The Calculator filter's output is of the same data set type as the input.
Property | Description | Default Value(s) | Restrictions |
Coordinate Scalar Variable (AddCoordinateScalarVariable) |
This property adds a new scalar variable (single-component array or a single component of a multi-component array) to the current function for computing new point coordinates.
|
|
|
Coordinate Vector Variable (AddCoordinateVectorVariable) |
This property adds a new vector variable (multi-component array) to the current function for computing new point coordinates.
|
|
|
Scalar Variable (AddScalarVariable) |
This property adds a new scalar variable (single-component array or a single component of a multi-component array) to the current function for computing a new array.
|
|
|
Vector Variable (AddVectorVariable) |
This property adds a new vector variable (multi-component array) to the current function for computing a new array.
|
|
|
Attribute Mode (AttributeMode) |
This property determines whether the computation is to be performed on point-centered or cell-centered data.
|
0 |
The value must be one of the following: point_data (1), cell_data (2).
|
Coordinate Results (CoordinateResults) |
The value of this property determines whether the results of this computation should be used as point coordinates or as a new array.
|
0 |
Only the values 0 and 1 are accepted.
|
Function (Function) |
This property contains the equation for computing the new array.
|
|
|
Input (Input) |
This property specifies the input dataset to the Calculator filter. The scalar and vector variables may be chosen from this dataset's arrays.
|
|
The selected object must be the result of the following: sources (includes readers), filters.
The dataset must contain a point or cell array.
The selected dataset must be one of the following types (or a subclass of one of them): vtkDataSet.
|
Clear (RemoveAllVariables) |
This property erases the current function from the calculator. (See the Function property.)
|
|
|
Replace Invalid Results (ReplaceInvalidValues) |
This property determines whether invalid values in the computation will be replaced with a specific value. (See the ReplacementValue property.)
|
1 |
Only the values 0 and 1 are accepted.
|
Replacement Value (ReplacementValue) |
If invalid values in the computation are to be replaced with another value, this property contains that value.
|
0 |
|
Result Array Name (ResultArrayName) |
This property contains the name for the output array containing the result of this computation.
|
Result |
|