[Ruby 1.9 - Bug #4891][Open] Vector#normalize

Issue #4891 has been reported by Kenta M…


Bug #4891: Vector#normalize

Author: Kenta M.
Status: Open
Priority: Normal
Assignee: Keiju Ishitsuka
Category: lib
Target version: 1.9.x
ruby -v: ruby 1.9.3dev (2011-06-13 trunk 32053) [x86_64-darwin10.7.0]

知人からベクトルを正規化するメソッドが無いよと言われました。

いままで誰も気付かなかった (もしくは気付いても放っておいた) のですが、
存在してて当然のメソッドのような気がするので追加の提案をします。

パッチはこれです。

Issue #4891 has been updated by Kenta M…

Bug じゃなくて Feature にするつもりでした。
Bug から Feature へ後から変更することはできないんでしょうか?

Bug #4891: Vector#normalize

Author: Kenta M.
Status: Open
Priority: Normal
Assignee: Keiju Ishitsuka
Category: lib
Target version: 1.9.x
ruby -v: ruby 1.9.3dev (2011-06-13 trunk 32053) [x86_64-darwin10.7.0]

知人からベクトルを正規化するメソッドが無いよと言われました。

いままで誰も気付かなかった (もしくは気付いても放っておいた) のですが、
存在してて当然のメソッドのような気がするので追加の提案をします。

パッチはこれです。

Issue #4891 has been updated by Marc-Andre L…

Status changed from Open to Assigned
Assignee changed from Keiju Ishitsuka to Marc-Andre L.
Target version changed from 1.9.x 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)?

Feature #4891: Vector#normalize

Author: Kenta M.
Status: Assigned
Priority: Normal
Assignee: Marc-Andre L.
Category: lib
Target version: 1.9.3

知人からベクトルを正規化するメソッドが無いよと言われました。

いままで誰も気付かなかった (もしくは気付いても放っておいた) のですが、
存在してて当然のメソッドのような気がするので追加の提案をします。

パッチはこれです。

Hi,

On Sun, Jun 26, 2011 at 9:48 PM, Sakuro OZAWA [email protected]
wrote:

Just for curiosity’s sake, what is expected from Vector[0,0,0].normalize ?

I thought it should raise a new exception for this (say
Vector::ZeroVectorError), but as long as something is raised, I’ll be
happy. I feel domain errors should be reserved for functions over
Numerics.

Issue #4891 has been updated by Sakuro OZAWA.

=begin
Just for curiosity’s sake, what is expected from Vector[0,0,0].normalize
?

((<WolframAlpha|URL:normalize (0,0,0) - Wolfram|Alpha>))
says: the zero vector cannot be normalized.

  • The patch gives Vector[NaN, NaN, NaN].
  • returns (dup of) self?
  • domain error?
    =end

Feature #4891: Vector#normalize

Author: Kenta M.
Status: Assigned
Priority: Normal
Assignee: Marc-Andre L.
Category: lib
Target version: 1.9.3

知人からベクトルを正規化するメソッドが無いよと言われました。

いままで誰も気付かなかった (もしくは気付いても放っておいた) のですが、
存在してて当然のメソッドのような気がするので追加の提案をします。

パッチはこれです。

Issue #4891 has been updated by Marc-Andre L…

Status changed from Assigned to Closed
% Done changed from 0 to 100

Applied as r32467, thank you!

Feature #4891: Vector#normalize

Author: Kenta M.
Status: Closed
Priority: Normal
Assignee: Marc-Andre L.
Category: lib
Target version: 1.9.3

知人からベクトルを正規化するメソッドが無いよと言われました。

いままで誰も気付かなかった (もしくは気付いても放っておいた) のですが、
存在してて当然のメソッドのような気がするので追加の提案をします。

パッチはこれです。