1344件ヒット
[1-100件を表示]
(0.171秒)
ライブラリ
- ビルトイン (974)
- bigdecimal (12)
- cmath (120)
- fileutils (24)
-
json
/ add / complex (24) - mathn (8)
- matrix (110)
クラス
キーワード
- * (12)
- ** (12)
- + (12)
- - (12)
- -@ (24)
-
/ (35) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - < (12)
- <= (12)
- <=> (6)
- == (12)
- > (12)
- >= (12)
- I (12)
-
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) - Numeric (12)
- Rational (12)
- Ruby用語集 (12)
- abs (12)
- abs2 (12)
- acos (6)
- acosh (6)
- angle (24)
- antisymmetric? (7)
- arg (24)
- asin (6)
- asinh (6)
- atan (6)
- atan2 (6)
- atanh (6)
- between? (12)
- cbrt (6)
- clamp (12)
- coerce (12)
- conj (24)
- conjugate (36)
- copy (12)
- cos (6)
- cosh (6)
- cp (12)
- denominator (24)
- exp (6)
- fdiv (54)
- finite? (9)
- i (12)
- imag (24)
- imaginary (24)
- infinite? (18)
- inspect (12)
-
json
/ add / complex (12) -
json
_ create (12) - log (24)
- log10 (6)
- log2 (6)
- magnitude (24)
-
marshal
_ dump (12) - norm (12)
- numerator (24)
- phase (24)
- polar (36)
- quo (24)
- r (12)
- rationalize (24)
- real (36)
- real? (36)
- rect (36)
- rectangular (36)
- rsqrt (4)
- sin (6)
- sinh (6)
-
skew
_ symmetric? (7) -
slice
_ before (24) - sqrt (10)
- tan (6)
- tanh (6)
-
to
_ c (48) -
to
_ f (12) -
to
_ i (12) -
to
_ json (12) -
to
_ r (12) -
to
_ s (12) - tr (12)
- trace (12)
検索結果
先頭5件
-
Complex (44090.0)
-
複素数を扱うクラスです。
...
Complex オブジェクトを作成するには、Kernel.#Complex、
Complex.rect、Complex.polar、Numeric#to_c、
String#to_c のいずれかを使用します。
//emlist[Complex オブジェクトの作り方][ruby]{
Complex(1) # => (1+0i)
Complex(2, 3) # => (2+3i)
Complex.po......lar(2, 3) # => (-1.9799849932008908+0.2822400161197344i)
Complex(0.3) # => (0.3+0i)
Complex('0.3-0.5i') # => (0.3-0.5i)
Complex('2/3+3/4i') # => ((2/3)+(3/4)*i)
Complex('1@2') # => (-0.4161468365471424+0.9092974268256817i)
3.to_c # => (3+0i)
0.3.to_c # => (......# => ((2/3)+(3/4)*i)
'1@2'.to_c # => (-0.4161468365471424+0.9092974268256817i)
//}
Complex オブジェクトは有理数の形式も実数の形式も扱う事ができます。
//emlist[例][ruby]{
Complex(1, 1) / 2 # => ((1/2)+(1/2)*i)
Complex(1, 1) / 2.0 # => (0.5+0.5i)
//}... -
Complex
# coerce(other) -> [Complex , Complex] (27424.0) -
other を Complex に変換して [変換後の other, self] の配列を返します。
...other を Complex に変換して [変換後の other, self] の配列を返します。
@raise TypeError 変換できないオブジェクトを指定した場合に発生します。
//emlist[例][ruby]{
Complex(1).coerce(2) # => [(2+0i), (1+0i)]
//}... -
Complex
. rect(r , i = 0) -> Complex (27242.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...る Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
//emlist[例][ruby]{
Complex.rect(1) # => (1+0i)
Complex.rect(1, 2) # => (1+2i)
Complex.rectangul......ar(1, 2) # => (1+2i)
//}
@see Kernel.#Complex... -
Complex
. rectangular(r , i = 0) -> Complex (27242.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...る Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
//emlist[例][ruby]{
Complex.rect(1) # => (1+0i)
Complex.rect(1, 2) # => (1+2i)
Complex.rectangul......ar(1, 2) # => (1+2i)
//}
@see Kernel.#Complex... -
Complex
# numerator -> Complex (27219.0) -
分子を返します。
...分子を返します。
//emlist[例][ruby]{
Complex('1/2+2/3i').numerator # => (3+4i)
Complex(3).numerator # => (3+0i)
//}
@see Complex#denominator... -
Complex
. json _ create(hash) -> Complex (27217.0) -
JSON のオブジェクトから Complex のオブジェクトを生成して返します。
...JSON のオブジェクトから Complex のオブジェクトを生成して返します。
@param hash 実部をキー 'r'、虚部をキー 'i' に持つハッシュを指定します。... -
Complex
# conjugate -> Complex (27208.0) -
自身の共役複素数を返します。
...自身の共役複素数を返します。
//emlist[例][ruby]{
Complex(1, 2).conj # => (1-2i)
//}... -
Complex
# angle -> Float (27148.0) -
自身の偏角を[-π,π]の範囲で返します。
...囲で返します。
//emlist[例][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 Numeric#arg... -
Complex
# phase -> Float (27148.0) -
自身の偏角を[-π,π]の範囲で返します。
...囲で返します。
//emlist[例][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 Numeric#arg...