Vector products: Difference between revisions
Content added Content deleted
(Added PowerShell) |
m (→{{header|J}}) |
||
Line 1,225: | Line 1,225: | ||
=={{header|J}}== |
=={{header|J}}== |
||
Perhaps the most straightforward definition for cross product in J uses rotate |
Perhaps the most straightforward definition for cross product in J uses rotate multiply and subtract: |
||
<lang j>cross=: (1&|.@[ * 2&|.@]) - 2&|.@[ * 1&|.@]</lang> |
<lang j>cross=: (1&|.@[ * 2&|.@]) - 2&|.@[ * 1&|.@]</lang> |