Project

General

Profile

Feature #4891

Vector#normalize

Added by Kenta Murata over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
[ruby-dev:43829]

Description

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

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

パッチはこれです。
https://gist.github.com/1029140

History

#1 [ruby-dev:43830] Updated by Kenta Murata over 5 years ago

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

#2 Updated by sorah Shota Fukumori over 5 years ago

  • Tracker changed from Bug to Feature

#3 [ruby-dev:43857] Updated by Marc-Andre Lafortune over 5 years ago

  • Status changed from Open to Assigned
  • Assignee changed from Keiju Ishitsuka to 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)?

#4 [ruby-dev:43957] Updated by Sakuro OZAWA over 5 years ago

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

  • (()) says: the zero vector cannot be normalized.
  • The patch gives Vector[NaN, NaN, NaN].
  • returns (dup of) self?
  • domain error? =end

#5 [ruby-dev:44069] Updated by Marc-Andre Lafortune over 5 years ago

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

Applied as r32467, thank you!

Also available in: Atom PDF