るりまサーチ

最速Rubyリファレンスマニュアル検索!
1014件ヒット [1-100件を表示] (0.129秒)
トップページ > クエリ:l[x] > クエリ:>[x] > クエリ:Complex[x]

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l
  5. l matrix

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Complex#>(other) -> bool (42200.0)

@undef

@undef

Complex#<=>(other) -> -1 | 0 | 1 | nil (30252.0)

self の虚部がゼロで other が実数の場合、 self の実部の <=> メソッドで other と比較した結果を返します。 other が Complex で虚部がゼロの場合も同様です。

...self の虚部がゼロで other が実数の場合、
self の実部の <=> メソッドで other と比較した結果を返します。
other が Complex で虚部がゼロの場合も同様です。

その他の場合は nil を返します。

@param other 自身と比較する数値

//emlis...
...t[例][ruby]{
Complex
(2, 3) <=> Complex(2, 3) #=> nil
Complex
(2, 3) <=> 1 #=> nil
Complex
(2) <=> 1 #=> 1
Complex
(2) <=> 2 #=> 0
Complex
(2) <=> 3 #=> -1
//}...

Complex#angle -> Float (30248.0)

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

...す。

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

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

//emlist[例][ruby]{
Complex
(-1, 0).arg #=> 3.1415926...
...589793
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.141592...

Complex#>=(other) -> bool (30200.0)

@undef

@undef

Complex.rectangular(r, i = 0) -> Complex (27342.0)

実部が r、虚部が i である Complex クラスのオブジェクトを生成します。

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

@param r 生成する複素数の実部。

@param i 生成する複素数の虚部。省略した場合は 0 です。

//emlist[例][ruby]{
Complex
.rect(1) # => (1+0i)
Complex
.rect(1, 2) # => (1+2i)
Complex
.rectangular(...
...1, 2) # => (1+2i)
//}

@see Kernel.#Complex...

絞り込み条件を変える

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

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

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

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

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

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

Complex#arg -> Float (27248.0)

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

...す。

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

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

//emlist[例][ruby]{
Complex
(-1, 0).arg #=> 3.1415926...
...589793
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.141592...

Complex#phase -> Float (27248.0)

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

...す。

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

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

//emlist[例][ruby]{
Complex
(-1, 0).arg #=> 3.1415926...
...589793
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.141592...

Complex#marshal_dump -> Array (27228.0)

Marshal.#load のためのメソッドです。 Complex::compatible#marshal_load で復元可能な配列を返します。

...Marshal.#load のためのメソッドです。
Complex
::compatible#marshal_load で復元可能な配列を返します。

2.0 以降では Marshal.#load で 1.8 系の Complex オブジェクト
を保存した文字列も復元できます。

[注意] Complex::compatible は通常の方法で...

Complex#rectangular -> [Numeric, Numeric] (27218.0)

実部と虚部を配列にして返します。

...実部と虚部を配列にして返します。

//emlist[例][ruby]{
Complex
(3).rect # => [3, 0]
Complex
(3.5).rect # => [3.5, 0]
Complex
(3, 2).rect # => [3, 2]
//}

@see Numeric#rect...

絞り込み条件を変える

<< 1 2 3 ... > >>