Difference between revisions of "Cross Command"

From GeoGebra Manual
Jump to: navigation, search
m
(Use vectors rather than lists in examples, reordered)
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''.
+
: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}''.</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>}}
:{{note| 1=In the [[Input Bar]] you can also use <code><nowiki>u ⊗ v</nowiki></code>.}}
+
:For 2D vectors or points the result is the z-coordinate of the actual cross product.
:{{hint|1=
+
:{{example|<code><nowiki>Cross[(1,2),(4,5)]</nowiki></code> yields -3.}}
If a vector in the [[File:Menu view cas.svg|link=|16px]] [[CAS View]] contains undefined variables, the command yields a formula for the cross product.
+
{{hint|1=If a vector in the [[File:Menu view cas.svg|link=|16px]] [[CAS View]] contains undefined variables, the command yields a formula for the cross product, e.g.
::{{example|1=<div><code><nowiki>Cross[{a, b, c}, {d, e, f}]</nowiki></code> yields ''{b f - c e, -a f + c d, a e - b d}''.</div>}}
+
<code><nowiki>Cross[(a, b, c), (d, e, f)]</nowiki></code> yields ''(b f - c e, -a f + c d, a e - b d)''.
 
}}
 
}}
{{note| 1=<div>See also [[Dot Command]].</div>}}
+
{{notes| 1=
 +
* You can also use the [[Predefined_Functions_and_Operators|operator]] <code><nowiki>u ⊗ v</nowiki></code><div>
 +
* See also [[Dot Command]].</div>}}

Revision as of 11:27, 2 September 2015


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.
Note Hint: If a vector in the Menu view cas.svg 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:
© 2024 International GeoGebra Institute