VECTORDEF: Difference between revisions
(Created page with "{{Keyword | 1= <code>VECTORDEF symbol</code> <code>@label@ { options } VECTORDEF [*] symbol = expression</code> | 2= Defines the symbol to be a vector. This i...") |
mNo edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 7: | Line 7: | ||
| | | | ||
2= | 2= | ||
Declares the symbol to be a vector. This is important because vectors are non-commutative when evaluating an expression. | |||
The second form is a shortcut for the combination of <code>VECTORDEF</code> and <code>[[EQDEF]]</code>. It defines the symbol and creates an equation defining its value. | The second form is a shortcut for the combination of <code>VECTORDEF</code> and <code>[[EQDEF]]</code>. It defines the symbol and creates an equation defining its value. | ||
Note that the vector symbol is not identical with another symbol that has the same name but a different commutativity. To avoid confusion, always define your symbols as vectors before you use them for the first time. | |||
| | | | ||
3= | 3= | ||
<code>VECTORDEF v</code> | <code>VECTORDEF v</code> | ||
<code>VECTORDEF u = (a | <code>@u@ VECTORDEF u = left(STACK{ a # b # c }right)</code> | ||
Declares two vectors <code>u</code> and <code>v</code> and assigns a value to <code>v</code>. In expression evaluation, iMath will treat the vectors as non-commutative, that is, <code>u v ≠ v u</code>. | |||
|4= | |||
[[MATRIXDEF]] | |||
}} | }} | ||
[[Category:Definition]] | [[Category:Declaration]][[Category:Definition]] | ||
Latest revision as of 20:40, 21 February 2025
Syntax
VECTORDEF symbol
@label@ { options } VECTORDEF [*] symbol = expression
Implemented in iMath since version 2.2.0 or earlier.
Explanation
Declares the symbol to be a vector. This is important because vectors are non-commutative when evaluating an expression.
The second form is a shortcut for the combination of VECTORDEF and EQDEF. It defines the symbol and creates an equation defining its value.
Note that the vector symbol is not identical with another symbol that has the same name but a different commutativity. To avoid confusion, always define your symbols as vectors before you use them for the first time.
Example
VECTORDEF v
@u@ VECTORDEF u = left(STACK{ a # b # c }right)
Declares two vectors u and v and assigns a value to v. In expression evaluation, iMath will treat the vectors as non-commutative, that is, u v ≠ v u.