ライブラリ
- ビルトイン (881)
- bigdecimal (11)
- cmath (120)
- fileutils (22)
-
json
/ add / complex (22) - mathn (8)
- matrix (133)
クラス
キーワード
- * (11)
- ** (11)
- + (11)
- - (11)
- -@ (22)
-
/ (21) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - < (11)
- <= (11)
- <=> (5)
- == (11)
- > (11)
- >= (11)
- I (11)
-
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) - Numeric (11)
- Rational (11)
- Ruby用語集 (11)
- abs (11)
- abs2 (11)
- acos (6)
- acosh (6)
- angle (22)
- antisymmetric? (6)
- arg (22)
- asin (6)
- asinh (6)
- atan (6)
- atan2 (6)
- atanh (6)
- between? (11)
- cbrt (6)
- clamp (11)
- coerce (11)
- conj (33)
- conjugate (33)
- copy (11)
- cos (6)
- cosh (6)
- cp (11)
- denominator (22)
- exp (6)
- fdiv (50)
- finite? (8)
- i (11)
- imag (33)
- imaginary (33)
- infinite? (16)
- inspect (11)
-
json
/ add / complex (11) -
json
_ create (11) - log (23)
- log10 (6)
- log2 (6)
- magnitude (22)
-
marshal
_ dump (11) - mathn (4)
- matrix (11)
- norm (11)
- numerator (22)
- phase (22)
- polar (33)
- quo (22)
- r (11)
- rationalize (22)
- real (33)
- real? (33)
- rect (33)
- rectangular (33)
- rsqrt (4)
- sin (6)
- sinh (6)
-
skew
_ symmetric? (6) -
slice
_ before (22) - sqrt (10)
- tan (6)
- tanh (6)
-
to
_ c (44) -
to
_ f (11) -
to
_ i (11) -
to
_ json (11) -
to
_ r (11) -
to
_ s (11) - tr (11)
- trace (11)
検索結果
先頭5件
-
Complex (38090.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] (21224.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 (21142.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...ある Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
//emlist[例][ruby]{
Complex.rect(1) # => (1+0i)
Complex.rect(1, 2) # => (1+2i)
Complex.rectan......gular(1, 2) # => (1+2i)
//}
@see Kernel.#Complex... -
Complex
. rectangular(r , i = 0) -> Complex (21142.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...ある Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
//emlist[例][ruby]{
Complex.rect(1) # => (1+0i)
Complex.rect(1, 2) # => (1+2i)
Complex.rectan......gular(1, 2) # => (1+2i)
//}
@see Kernel.#Complex... -
Complex
. polar(r , theta = 0) -> Complex (21135.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
# *(other) -> Complex (21125.0) -
積を計算します。
...積を計算します。
@param other 自身に掛ける数
//emlist[例][ruby]{
Complex(1, 2) * 2 # => (2+4i)
Complex(1, 2) * Complex(2, 3) # => (-4+7i)
Complex(1, 2) * Rational(1, 2) # => ((1/2)+(1/1)*i)
//}... -
Complex
# fdiv(other) -> Complex (21119.0) -
self を other で割った商を返します。 実部と虚部が共に Float の値になります。
...elf を other で割った商を返します。
実部と虚部が共に Float の値になります。
@param other 自身を割る数
//emlist[例][ruby]{
Complex(11, 22).fdiv(3) # => (3.6666666666666665+7.333333333333333i)
Complex(11, 22).quo(3) # => ((11/3)+(22/3)*i)
//}
@see Complex#quo... -
Complex
# numerator -> Complex (21119.0) -
分子を返します。
...分子を返します。
//emlist[例][ruby]{
Complex('1/2+2/3i').numerator # => (3+4i)
Complex(3).numerator # => (3+0i)
//}
@see Complex#denominator... -
Complex
. json _ create(hash) -> Complex (21117.0) -
JSON のオブジェクトから Complex のオブジェクトを生成して返します。
...JSON のオブジェクトから Complex のオブジェクトを生成して返します。
@param hash 実部をキー 'r'、虚部をキー 'i' に持つハッシュを指定します。... -
Complex
# / (other) -> Complex (21114.0) -
商を計算します。
...商を計算します。
@param other 自身を割る数
//emlist[例][ruby]{
Complex(10.0) / 3 # => (3.3333333333333335+(0/1)*i)
Complex(10) / 3 # => ((10/3)+(0/1)*i)
//}
@see Numeric#quo...