Ruby 1.9.2 Reference Manual > All Libraries > Builtin Library > class Numeric > angle

instance method Numeric#angle

arg -> 0 | Math::PI
angle -> 0 | Math::PI
phase -> 0 | Math::PI

自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。

例:

1.arg  # => 0
-1.arg # => 3.141592653589793

Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。