15件ヒット
[1-15件を表示]
(0.224秒)
検索結果
先頭5件
-
Complex
# rect -> [Numeric , Numeric] (24643.0) -
実部と虚部を配列にして返します。
...実部と虚部を配列にして返します。
//emlist[例][ruby]{
Complex(3).rect # => [3, 0]
Complex(3.5).rect # => [3.5, 0]
Complex(3, 2).rect # => [3, 2]
//}
@see Numeric#rect... -
Complex
# rectangular -> [Numeric , Numeric] (24643.0) -
実部と虚部を配列にして返します。
...実部と虚部を配列にして返します。
//emlist[例][ruby]{
Complex(3).rect # => [3, 0]
Complex(3.5).rect # => [3.5, 0]
Complex(3, 2).rect # => [3, 2]
//}
@see Numeric#rect... -
Complex
# polar -> [Numeric , Numeric] (24637.0) -
自身の絶対値と偏角を配列にして返します。
...自身の絶対値と偏角を配列にして返します。
//emlist[例][ruby]{
Complex.polar(1, 2).polar # => [1, 2]
//}
@see Numeric#polar... -
Complex
# imag -> Numeric (24337.0) -
自身の虚部を返します。
...自身の虚部を返します。
//emlist[例][ruby]{
Complex(3, 2).imag # => 2
//}
@see Numeric#imag... -
Complex
# imaginary -> Numeric (24337.0) -
自身の虚部を返します。
...自身の虚部を返します。
//emlist[例][ruby]{
Complex(3, 2).imag # => 2
//}
@see Numeric#imag... -
Complex
# abs -> Numeric (24319.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
# magnitude -> Numeric (24319.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 (24316.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
# real -> Numeric (24316.0) -
自身の実部を返します。
...自身の実部を返します。
//emlist[例][ruby]{
Complex(3, 2).real # => 3
//}... -
Complex
# / (other) -> Complex (24031.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... -
Complex
# angle -> Float (24031.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 (24031.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 (24031.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
# quo(other) -> Complex (24031.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... -
Complex
# real? -> false (24031.0) -
常に false を返します。
常に false を返します。
//emlist[例][ruby]{
(2+3i).real? # => false
(2+0i).real? # => false
//}
@see Numeric#real?