るりまサーチ

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

別のキーワード

  1. _builtin complex
  2. complex rect
  3. complex polar
  4. kernel complex
  5. complex rationalize

ライブラリ

キーワード

検索結果

<< < 1 2 3 4 5 ... > >>

Complex#angle -> Float (21049.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 (21049.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 (21049.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#==(other) -> bool (21031.0)

数値として等しいか判定します。

...数値として等しいか判定します。

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

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

Complex#inspect -> String (21031.0)

自身を人間が読みやすい形の文字列表現にして返します。

...

//emlist[例][ruby]{
Complex
(2).inspect # => "(2+0i)"
Complex
('-8/6').inspect # => "((-4/3)+0i)"
Complex
('1/2i').inspect # => "(0+(1/2)*i)"
Complex
(0, Float::INFINITY).inspect # => "(0+Infinity*i)"
Complex
(Float::NAN, Float::NAN).insp...

絞り込み条件を変える

Complex#to_s -> String (21031.0)

自身を "実部 + 虚部i" 形式の文字列にして返します。

...て返します。

//emlist[例][ruby]{
Complex
(2).to_s # => "2+0i"
Complex
('-8/6').to_s # => "-4/3+0i"
Complex
('1/2i').to_s # => "0+1/2i"
Complex
(0, Float::INFINITY).to_s # => "0+Infinity*i"
Complex
(Float::NAN, Float::NAN).to_s # => "Na...

Complex#marshal_dump -> Array (21029.0)

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

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

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

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

Complex#abs -> Numeric (21025.0)

自身の絶対値を返します。

...す。

以下の計算の結果を Float オブジェクトで返します。

sqrt(self.real ** 2 + self.imag ** 2)

//emlist[例][ruby]{
Complex
(1, 2).abs # => 2.23606797749979
Complex
(3, 4).abs # => 5.0
Complex
('1/2', '1/2').abs # => 0.7071067811865476
//}

@see Complex#abs2...

Complex#abs2 -> Numeric (21025.0)

自身の絶対値の 2 乗を返します。

...自身の絶対値の 2 乗を返します。

以下の計算の結果を返します。

self.real ** 2 + self.imag ** 2

//emlist[例][ruby]{
Complex
(1, 1).abs2 # => 2
Complex
(1.0, 1.0).abs2 # => 2.0
Complex
('1/2', '1/2').abs2 # => (1/2)
//}

@see Complex#abs...

Complex#magnitude -> Numeric (21025.0)

自身の絶対値を返します。

...す。

以下の計算の結果を Float オブジェクトで返します。

sqrt(self.real ** 2 + self.imag ** 2)

//emlist[例][ruby]{
Complex
(1, 2).abs # => 2.23606797749979
Complex
(3, 4).abs # => 5.0
Complex
('1/2', '1/2').abs # => 0.7071067811865476
//}

@see Complex#abs2...

絞り込み条件を変える

<< < 1 2 3 4 5 ... > >>