るりまサーチ (Ruby 2.2.0)

最速Rubyリファレンスマニュアル検索!
5件ヒット [1-5件を表示] (0.034秒)
トップページ > クラス:Complex[x] > クエリ:complex[x] > バージョン:2.2.0[x] > ライブラリ:ビルトイン[x] > クエリ:polar[x]

別のキーワード

  1. _builtin complex
  2. complex rect
  3. complex rectangular
  4. complex rationalize

キーワード

検索結果

Complex.polar(r, theta = 0) -> Complex (81772.0)

絶対値が r、偏角が theta である Complex クラスのオブジェクトを生成します。

... Complex クラスのオブジェクトを生成します。

@param r 生成する複素数の絶対値。

@param theta 生成する複素数の偏角。単位はラジアンです。省略した場合は 0 です。

//emlist[例][ruby]{
Complex
.polar(2.0) # => (2.0+0.0i)
Complex
.po...
...lar(2.0, 0) # => (2.0+0.0i)
Complex
.polar(2.0, Math::PI) # => (-2.0+2.4492127076447545e-16i)
//}...

Complex#polar -> [Numeric, Numeric] (81385.0)

自身の絶対値と偏角を配列にして返します。

...自身の絶対値と偏角を配列にして返します。

//emlist[例][ruby]{
Complex
.polar(1, 2).polar # => [1, 2]
//}

@see Numeric#polar...

Complex#angle -> Float (27172.0)

自身の偏角を[-π,π]の範囲で返します。

...ruby]{
Complex
.polar(3, Math::PI/2).arg # => 1.5707963267948966
//}

非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。

//emlist[例][ruby]{
Complex
(-1, 0).arg #=> 3.141592653589793
Complex
(-1, -...
...0).arg #=> 3.141592653589793
Complex
(-1, -0.0).arg #=> -3.141592653589793

Complex
(0, 0.0).arg #=> 0.0
Complex
(0, -0.0).arg #=> -0.0
Complex
(-0.0, 0).arg #=> 3.141592653589793
Complex
(-0.0, -0.0).arg #=> -3.141592653589793
//}


@see...

Complex#arg -> Float (27172.0)

自身の偏角を[-π,π]の範囲で返します。

...ruby]{
Complex
.polar(3, Math::PI/2).arg # => 1.5707963267948966
//}

非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。

//emlist[例][ruby]{
Complex
(-1, 0).arg #=> 3.141592653589793
Complex
(-1, -...
...0).arg #=> 3.141592653589793
Complex
(-1, -0.0).arg #=> -3.141592653589793

Complex
(0, 0.0).arg #=> 0.0
Complex
(0, -0.0).arg #=> -0.0
Complex
(-0.0, 0).arg #=> 3.141592653589793
Complex
(-0.0, -0.0).arg #=> -3.141592653589793
//}


@see...

Complex#phase -> Float (27172.0)

自身の偏角を[-π,π]の範囲で返します。

...ruby]{
Complex
.polar(3, Math::PI/2).arg # => 1.5707963267948966
//}

非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。

//emlist[例][ruby]{
Complex
(-1, 0).arg #=> 3.141592653589793
Complex
(-1, -...
...0).arg #=> 3.141592653589793
Complex
(-1, -0.0).arg #=> -3.141592653589793

Complex
(0, 0.0).arg #=> 0.0
Complex
(0, -0.0).arg #=> -0.0
Complex
(-0.0, 0).arg #=> 3.141592653589793
Complex
(-0.0, -0.0).arg #=> -3.141592653589793
//}


@see...

絞り込み条件を変える