Jump to content

Vector products: Difference between revisions

Add APL
(Updated to work with Nim 1.4: replaced "~×" and "~•" with "cross" and "dot" as the infix notation no longer works. Used "strformat". Other miscellaneous changes.)
(Add APL)
Line 270:
a x ( b x c ): (-267, 204, -3)
</pre>
 
=={{header|APL}}==
{{works with|Dyalog APL}}
<lang APL>dot ← +.×
cross ← 1⌽(⊣×1⌽⊢)-⊢×1⌽⊣</lang>
{{out}}
<lang APL> a←3 4 5
b←4 3 5
c←¯5 ¯12 ¯13
a dot b
49
a cross b
5 5 ¯7
a dot b cross c
6
a cross b cross c
¯267 204 ¯3</lang>
 
=={{header|AppleScript}}==
2,115

edits

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