visual3d:documentation:pipeline:expressions:mathematical_operators
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
visual3d:documentation:pipeline:expressions:mathematical_operators [2024/11/04 20:28] – wikisysop | visual3d:documentation:pipeline:expressions:mathematical_operators [2024/11/04 20:30] (current) – wikisysop | ||
---|---|---|---|
Line 25: | Line 25: | ||
Note: Visual3D parses the mathematical operators before it parses the signal names. If you have a signal name that contains a mathematical operator (e.g. R-Foot1), Visual3D will probably not be able to parse the equation expression properly. | Note: Visual3D parses the mathematical operators before it parses the signal names. If you have a signal name that contains a mathematical operator (e.g. R-Foot1), Visual3D will probably not be able to parse the equation expression properly. | ||
- | ==== Arithmetic Operators ==== | + | ===== Arithmetic Operators |
Arithmetic operations can generally be performed using syntax that is similar to that found in a variety of programming and scripting languages. | Arithmetic operations can generally be performed using syntax that is similar to that found in a variety of programming and scripting languages. | ||
- | === Plus === | + | ==== Plus ==== |
Addition is accomplished using the + character. An alternative syntax is **add(a, | Addition is accomplished using the + character. An alternative syntax is **add(a, | ||
Line 40: | Line 40: | ||
</ | </ | ||
- | === Minus === | + | ==== Minus ==== |
Subtraction is accomplished using the - character. | Subtraction is accomplished using the - character. | ||
Line 48: | Line 48: | ||
</ | </ | ||
- | === Multiply === | + | ==== Multiply |
Multiplication is accomplished using the * character. | Multiplication is accomplished using the * character. | ||
Line 56: | Line 56: | ||
</ | </ | ||
- | === Divide === | + | ==== Divide |
Division is accomplished using the / character. | Division is accomplished using the / character. | ||
Line 64: | Line 64: | ||
</ | </ | ||
- | === Power === | + | ==== Power ==== |
Exponentiation is accomplished using the ^ character. | Exponentiation is accomplished using the ^ character. | ||
Line 72: | Line 72: | ||
</ | </ | ||
- | ==== Boolean Operators ==== | + | ===== Boolean Operators |
Boolean operators deal with boolean values, such as TRUE and FALSE. These are represented numerically as 1 (TRUE) and 0 (FALSE). | Boolean operators deal with boolean values, such as TRUE and FALSE. These are represented numerically as 1 (TRUE) and 0 (FALSE). | ||
- | === Logical OR === | + | ==== Logical OR ==== |
The Logical OR operator is signified by the | character. It takes two boolean values as input and returns TRUE if either of the input values is TRUE. | The Logical OR operator is signified by the | character. It takes two boolean values as input and returns TRUE if either of the input values is TRUE. | ||
Line 87: | Line 87: | ||
</ | </ | ||
- | === Logical AND === | + | ==== Logical AND ==== |
The Logical AND operator is signified by the & character. It takes two boolean values as input and returns TRUE when both input values are TRUE. | The Logical AND operator is signified by the & character. It takes two boolean values as input and returns TRUE when both input values are TRUE. | ||
Line 98: | Line 98: | ||
</ | </ | ||
- | === The Adjective NOT === | + | ==== The Adjective NOT ==== |
The logical adjective NOT can be used with both the logical AND and logical OR operators. It takes one boolean value as input and negates that boolean value. | The logical adjective NOT can be used with both the logical AND and logical OR operators. It takes one boolean value as input and negates that boolean value. | ||
Line 107: | Line 107: | ||
</ | </ | ||
- | ==Example== | + | ===Example=== |
Given a workspace containing 3 trials (*trial1.c3d, | Given a workspace containing 3 trials (*trial1.c3d, | ||
Line 131: | Line 131: | ||
This command results in *trial2.c3d and *trial3.c3d being active. | This command results in *trial2.c3d and *trial3.c3d being active. | ||
- | ==== Comparison Operators ==== | + | ===== Comparison Operators |
Comparison operators take two inputs of the same type and return a boolean value. | Comparison operators take two inputs of the same type and return a boolean value. | ||
- | === Equals === | + | ==== Equals |
Equality is tested using either = or ==. It returns TRUE if the two inputs have the same value and FALSE if they do not. | Equality is tested using either = or ==. It returns TRUE if the two inputs have the same value and FALSE if they do not. | ||
- | ==Example== | + | ===Example=== |
Consider a model metric that is defined as a string and compare it to an explicitly defined string. | Consider a model metric that is defined as a string and compare it to an explicitly defined string. | ||
Line 160: | Line 160: | ||
The text strings are equal, so the resulting signal contains a 1 (indicating TRUE). | The text strings are equal, so the resulting signal contains a 1 (indicating TRUE). | ||
- | === Not Equals === | + | ==== Not Equals |
Non-equality is tested using either <> or ><. Its behaviour is opposite that of equality. | Non-equality is tested using either <> or ><. Its behaviour is opposite that of equality. | ||
Line 166: | Line 166: | ||
If (a==b) is TRUE then (a<> | If (a==b) is TRUE then (a<> | ||
- | === Less Than === | + | ==== Less Than ==== |
We can test is one value is less than another using the < character. | We can test is one value is less than another using the < character. | ||
- | ==Example== | + | ===Example=== |
Given two signals TARGET:: | Given two signals TARGET:: | ||
Line 185: | Line 185: | ||
The output signal will be 1 when RFT1::Z is less than LFT1::Z and 0 otherwise | The output signal will be 1 when RFT1::Z is less than LFT1::Z and 0 otherwise | ||
- | ==Example - Foot Clearance== | + | ===Example - Foot Clearance=== |
Heel and toe clearance are defined by two paths. It is possible to model "foot clearance" | Heel and toe clearance are defined by two paths. It is possible to model "foot clearance" | ||
Line 234: | Line 234: | ||
{{: | {{: | ||
- | === Less Than Or Equals === | + | ==== Less Than Or Equals |
This boolean operator uses one of the following syntaxes: <= or =<. | This boolean operator uses one of the following syntaxes: <= or =<. | ||
Line 240: | Line 240: | ||
The expression (a <= b) is equivalent logically to ((a < b) | (a == b)). | The expression (a <= b) is equivalent logically to ((a < b) | (a == b)). | ||
- | ==Example== | + | ===Example=== |
Given two signals TARGET:: | Given two signals TARGET:: | ||
Line 255: | Line 255: | ||
The output signal will be 1 (indicating TRUE) when RFT1::Z is less than or equal to LFT1::Z and 0 (indicating FALSE) otherwise. | The output signal will be 1 (indicating TRUE) when RFT1::Z is less than or equal to LFT1::Z and 0 (indicating FALSE) otherwise. | ||
- | === Greater Than === | + | ==== Greater Than ==== |
We can test is one value is less than another using the > character. | We can test is one value is less than another using the > character. | ||
- | ==Example== | + | ===Example=== |
Given two signals TARGET:: | Given two signals TARGET:: | ||
Line 274: | Line 274: | ||
The output signal will be 1 (indicating TRUE) when RFT1::Y is greater than LFT1::Y and 0 (indicating FALSE) otherwise. | The output signal will be 1 (indicating TRUE) when RFT1::Y is greater than LFT1::Y and 0 (indicating FALSE) otherwise. | ||
- | === Greater Than Or Equals === | + | ==== Greater Than Or Equals |
This boolean operator uses one of the following syntaxes: >= or =>. | This boolean operator uses one of the following syntaxes: >= or =>. |
visual3d/documentation/pipeline/expressions/mathematical_operators.1730752116.txt.gz · Last modified: 2024/11/04 20:28 by wikisysop