Actions
Feature #4891
closedVector#normalize
Description
知人からベクトルを正規化するメソッドが無いよと言われました。
いままで誰も気付かなかった (もしくは気付いても放っておいた) のですが、
存在してて当然のメソッドのような気がするので追加の提案をします。
パッチはこれです。
https://gist.github.com/1029140
Updated by mrkn (Kenta Murata) over 13 years ago
Bug じゃなくて Feature にするつもりでした。
Bug から Feature へ後から変更することはできないんでしょうか?
Updated by sorah (Sorah Fukumori) over 13 years ago
- Tracker changed from Bug to Feature
Updated by marcandre (Marc-Andre Lafortune) over 13 years ago
- Status changed from Open to Assigned
- Assignee changed from keiju (Keiju Ishitsuka) to marcandre (Marc-Andre Lafortune)
- Target version changed from 2.0.0 to 1.9.3
Sure.
I have to merge in my announced changes to Matrix & Vector in 1.9.3 as soon as I get the time, so I could include this too. Are we after the official feature freeze yet (I don't see the 1.9.3 branch)?
Updated by sakuro (Sakuro OZAWA) over 13 years ago
=begin
Just for curiosity's sake, what is expected from Vector[0,0,0].normalize ?
- ((<WolframAlpha|URL:http://www.wolframalpha.com/input/?i=normalize+%280%2C0%2C0%29>)) says: the zero vector cannot be normalized.
- The patch gives Vector[NaN, NaN, NaN].
- returns (dup of) self?
- domain error?
=end
Updated by marcandre (Marc-Andre Lafortune) over 13 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
Applied as r32467, thank you!
Actions
Like0
Like0Like0Like0Like0Like0