Vector products: Difference between revisions
Content added Content deleted
m (→{{header|Factor}}: whitespace/style tweaks) |
|||
Line 1,024: | Line 1,024: | ||
=={{header|Factor}}== |
=={{header|Factor}}== |
||
Factor has a fantastic <tt>math.vectors</tt> vocabulary, but in the spirit of the task, it is not used. |
Factor has a fantastic <tt>math.vectors</tt> vocabulary, but in the spirit of the task, it is not used. |
||
⚫ | |||
<lang factor> |
|||
⚫ | |||
IN: rosetta-code.vector-products |
|||
: dot-product ( a b -- dp ) [ * ] 2map sum ; |
: dot-product ( a b -- dp ) [ * ] 2map sum ; |
||
Line 1,055: | Line 1,053: | ||
"a . (b x c): " write a b c scalar-triple-product . |
"a . (b x c): " write a b c scalar-triple-product . |
||
"a x (b x c): " write a b c vector-triple-product . |
"a x (b x c): " write a b c vector-triple-product . |
||
⚫ | |||
] |
|||
⚫ | |||
{{out}} |
{{out}} |
||
<pre> |
<pre> |