Vector products: Difference between revisions
→{{header|Ruby}}: Removed Vector#cross_product (built in since Ruby 2.1)
(→{{header|Ruby}}: Removed Vector#cross_product (built in since Ruby 2.1)) |
|||
Line 2,788:
=={{header|Ruby}}==
Dot product is also known as ''inner product''. The standard library already defines Vector#inner_product and Vector# cross_product, so this program only defines the other
<lang ruby>require 'matrix'
class Vector
def scalar_triple_product(b, c)
self.inner_product(b.cross_product c)
|