From: qlli.illb@...
Date: 2014-07-19T15:22:11+00:00
Subject: [ruby-core:63876] [ruby-trunk - Feature #10074] [PATCH] generalize	Vector#cross_product

Issue #10074 has been updated by gogo tanaka.




Before

```
 Vector[1, 0, 0].cross_product Vector[0, 1, 0]
=> Vector[0, 0, 1]

Vector[1, 2].cross_product
=> ArgumentError: wrong number of arguments (0 for 1)

 Vector[3, 5, 2, 1].cross_product(Vector[4, 3, 1, 8], Vector[2, 9, 4, 3])
=> ArgumentError: wrong number of arguments (0 for 3)

```

After

```
 Vector[1, 0, 0].cross_product Vector[0, 1, 0]
=> Vector[0, 0, 1]

Vector[1, 2].cross_product
=> Vector[2, -1]

 Vector[3, 5, 2, 1].cross_product(Vector[4, 3, 1, 8], Vector[2, 9, 4, 3])
=> Vector[-16, 65, -139, 1]
```

----------------------------------------
Feature #10074: [PATCH] generalize Vector#cross_product
https://bugs.ruby-lang.org/issues/10074#change-47900

* Author: gogo tanaka
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
----------------------------------------
Usually We use cross_product in only 3 dimensions.

Sometimes we want to handle cross_product in n-dimensions.

But I recognize Ruby should be not for mathematician but rubyist.

Ruby doesn't need too academic method.

So If you think it is too academic you can ignore my patches.

---Files--------------------------------
generalize_Vector#cross_product.patch (1.71 KB)


-- 
https://bugs.ruby-lang.org/