Difference between revisions of "Cross Command"
From GeoGebra Manual
(Use vectors rather than lists in examples, reordered) |
(removing newline) |
||
Line 1: | Line 1: | ||
− | <noinclude>{{Manual Page|version=5.0}}</noinclude> {{command|cas=true|vector-matrix}} | + | <noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|cas=true|vector-matrix}};Cross[ <Vector u> , <Vector v> ] |
− | ;Cross[ <Vector u> , <Vector v> ] | ||
:Calculates the [[w:Cross_product|cross product]] of ''u'' and ''v''. Instead of vectors you can also use lists. | :Calculates the [[w:Cross_product|cross product]] of ''u'' and ''v''. Instead of vectors you can also use lists. | ||
:{{example| 1=<div><code><nowiki>Cross[(1, 3, 2), (0, 3, -2)]</nowiki></code> yields ''(-12, 2, 3)'', <code><nowiki>Cross[{1, 3, 2}, {0, 3, -2}]</nowiki></code> yields ''{-12, 2, 3}''</div>}} | :{{example| 1=<div><code><nowiki>Cross[(1, 3, 2), (0, 3, -2)]</nowiki></code> yields ''(-12, 2, 3)'', <code><nowiki>Cross[{1, 3, 2}, {0, 3, -2}]</nowiki></code> yields ''{-12, 2, 3}''</div>}} |
Revision as of 10:34, 17 March 2016
- Cross[ <Vector u> , <Vector v> ]
- Calculates the cross product of u and v. Instead of vectors you can also use lists.
- Example:
Cross[(1, 3, 2), (0, 3, -2)]
yields (-12, 2, 3),Cross[{1, 3, 2}, {0, 3, -2}]
yields {-12, 2, 3}
- For 2D vectors or points the result is the z-coordinate of the actual cross product.
- Example:
Cross[(1,2),(4,5)]
yields -3.
Hint: If a vector in the CAS View contains undefined variables, the command yields a formula for the cross product, e.g.
Cross[(a, b, c), (d, e, f)]
yields (b f - c e, -a f + c d, a e - b d). Notes:
- You can also use the operator
u ⊗ v
- See also Dot Command.