るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.050秒)
トップページ > クラス:Numeric[x] > クエリ:_builtin[x] > クエリ:complex[x] > クエリ:polar[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

検索結果

Numeric#polar -> [Numeric, Numeric] (26138.0)

自身の絶対値と偏角を配列にして返します。正の数なら [self, 0]、負の数な ら [-self, Math::PI] を返します。

...します。

//emlist[例][ruby]{
1.0.polar # => [1.0, 0]
2.0.polar # => [2.0, 0]
-1.0.polar # => [1.0, 3.141592653589793]
-2.0.polar # => [2.0, 3.141592653589793]
//}

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

@see Complex#polar...