Vector products: Difference between revisions

Content added Content deleted
m (* A starting page on Wolfram Mathworld is {{Wolfram|Vector|Mulitplication}}.)
(Added Wortel)
Line 2,375: Line 2,375:
v1 . (v2 x v3) = 6
v1 . (v2 x v3) = 6
v1 x (v2 x v3) = (-267, 204, -3)</pre>
v1 x (v2 x v3) = (-267, 204, -3)</pre>

=={{header|Wortel}}==
<lang wortel>@let {
dot &[a b] @sum @mapm ^* [a b]
cross &[a b] [[
-*a.1 b.2 *a.2 b.1
-*a.2 b.0 *a.0 b.2
-*a.0 b.1 *a.1 b.0
]]
scalarTripleProduct &[a b c] !!dot a !!cross b c
vectorTripleProduct &[a b c] !!cross a !!cross b c
a [3 4 5]
b [4 3 5]
c [5N 12N 13N]
[[
!!dot a b
!!cross a b
@!scalarTripleProduct [a b c]
@!vectorTripleProduct [a b c]
]]
}</lang>
Returns:
<pre>[49 [5 5 -7] 6 [-267 204 -3]]</pre>


=={{header|XPL0}}==
=={{header|XPL0}}==