Jump to content

Vector products: Difference between revisions

→‎JS ES6: Tidied and extended test.
m (made Wikipedia references more uniform.)
(→‎JS ES6: Tidied and extended test.)
Line 1,884:
 
console.log(unlines(
zipWith(k => f => k + show(
k => fapp(f)([a, =>b, k + show(c])
))(['a . b', 'a x b', 'a . fapp(fb x c)([a', 'a x (b, x c)'])(
)
)(['a . b', 'a x b', 'a . (b x c)', 'a x (b x c)'])(
[dotProduct, crossProduct, scalarTriple, vectorTriple]
)
.concat([
'a . d' + show(
dotProduct(a)(d)
),
)(['a . b', 'a x b', 'a . (b x cd)', 'a+ x (b x c)'])show(
scalarTriple(a)(b)(d)
)
])
));
console.log(
'a . d' + show(
dotProduct(a)(d)
)
)
};
 
Line 1,974 ⟶ 1,975:
a . (b x c) = 6
a x (b x c) = [-267,204,-3]
a . d => Dot product not defined - vectors differ in dimension</pre>.
a . (b x d) => crossProduct is defined only for 3d vectors.</pre>
 
=={{header|jq}}==
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.