るりまサーチ

最速Rubyリファレンスマニュアル検索!
121件ヒット [1-100件を表示] (0.013秒)

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

Complex#imag -> Numeric (27119.0)

自身の虚部を返します。

...自身の虚部を返します。

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

@see Numeric#imag...

Numeric#imag -> 0 (18137.0)

常に 0 を返します。

...常に 0 を返します。

//emlist[例][ruby]{
12.imag # => 0
-12.imag # => 0
1.2.imag # => 0
-1.2.imag # => 0
//}

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

@see Numeric#real、Complex#imag...

Matrix#imag -> Matrix (18125.0)

行列の虚部を返します。

...行列の虚部を返します。

//emlist[例][ruby]{
require 'matrix'
Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]]
# => 1+2i i 0
# 1 2 3
Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].imaginary
# => 2i i 0
# 0 0 0
//}...

Complex#imaginary -> Numeric (15119.0)

自身の虚部を返します。

...自身の虚部を返します。

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

@see Numeric#imag...

Complex#abs -> Numeric (9030.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 (9030.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 (9030.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...

Numeric#imaginary -> 0 (6137.0)

常に 0 を返します。

...常に 0 を返します。

//emlist[例][ruby]{
12.imag # => 0
-12.imag # => 0
1.2.imag # => 0
-1.2.imag # => 0
//}

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

@see Numeric#real、Complex#imag...

Matrix#imaginary -> Matrix (6125.0)

行列の虚部を返します。

...行列の虚部を返します。

//emlist[例][ruby]{
require 'matrix'
Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]]
# => 1+2i i 0
# 1 2 3
Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].imaginary
# => 2i i 0
# 0 0 0
//}...

Numeric (60.0)

数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。

...い。


=> ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin15]
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
% | o o o...
...< | - o o - -
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
<< | - o -...
...o o o
i | o - - - -
imag
| o - - - o
imag
inary | o - - - o
infinite? | o...

絞り込み条件を変える

<< 1 2 > >>