https://redmine.ruby-lang.org/
https://redmine.ruby-lang.org/favicon.ico?1711330511
2014-07-19T15:22:11Z
Ruby Issue Tracking System
Ruby master - Feature #10074: [PATCH] generalize Vector#cross_product
https://redmine.ruby-lang.org/issues/10074?journal_id=47900
2014-07-19T15:22:11Z
gogotanaka (Kazuki Tanaka)
mail@tanakakazuki.com
<ul></ul><p>Before</p>
<pre><code> 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 1)
</code></pre>
<p>After</p>
<pre><code> 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]
</code></pre>
<p>This patch needs <a href="https://bugs.ruby-lang.org/issues/10072" class="external">https://bugs.ruby-lang.org/issues/10072</a> and <a href="https://bugs.ruby-lang.org/issues/10073" class="external">https://bugs.ruby-lang.org/issues/10073</a></p>
<p>gogo.</p>
Ruby master - Feature #10074: [PATCH] generalize Vector#cross_product
https://redmine.ruby-lang.org/issues/10074?journal_id=47928
2014-07-20T19:09:20Z
hsbt (Hiroshi SHIBATA)
hsbt@ruby-lang.org
<ul><li><strong>Category</strong> set to <i>lib</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>marcandre (Marc-Andre Lafortune)</i></li><li><strong>Target version</strong> set to <i>2.2.0</i></li></ul>
Ruby master - Feature #10074: [PATCH] generalize Vector#cross_product
https://redmine.ruby-lang.org/issues/10074?journal_id=49704
2014-10-29T02:52:50Z
marcandre (Marc-Andre Lafortune)
marcandre-ruby-core@marc-andre.ca
<ul></ul><p>I committed this change, with a couple of changes.</p>
<p>In particular, the sign was wrong for even dimensions. I changed it so we now have, for any <code>n</code>:</p>
<pre><code>first, *middle, last = Matrix.identity(n).column_vectors
first.cross(*middle) == last
</code></pre>
<p>Thanks for this feature request!</p>
Ruby master - Feature #10074: [PATCH] generalize Vector#cross_product
https://redmine.ruby-lang.org/issues/10074?journal_id=49705
2014-10-29T02:53:05Z
marcandre (Marc-Andre Lafortune)
marcandre-ruby-core@marc-andre.ca
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul>
Ruby master - Feature #10074: [PATCH] generalize Vector#cross_product
https://redmine.ruby-lang.org/issues/10074?journal_id=49717
2014-10-29T05:58:39Z
gogotanaka (Kazuki Tanaka)
mail@tanakakazuki.com
<ul></ul><p>@Marc-Andre Lafortune</p>
<p>I'm really appreciate your help.<br>
And your changes totally makes sense.</p>
<p>Thanks.</p>