検索結果
先頭5件
-
Complex
. polar(r , theta = 0) -> Complex (18120) -
絶対値が r、偏角が theta である Complex クラスのオブジェクトを生成します。
...ある Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の絶対値。
@param theta 生成する複素数の偏角。単位はラジアンです。省略した場合は 0 です。
例:
Complex.polar(2.0) # => (2.0+0.0i)
Complex.polar(2.0,......0) # => (2.0+0.0i)
Complex.polar(2.0, Math::PI) # => (-2.0+2.4492127076447545e-16i)... -
Complex
# polar -> [Numeric , Numeric] (18114) -
自身の絶対値と偏角を配列にして返します。
...自身の絶対値と偏角を配列にして返します。
例:
Complex.polar(1, 2).polar # => [1, 2]... -
Complex
. polar(r , theta) -> Complex (18114) -
絶対値が r、偏角が theta である Complexクラスのオブジェクトを生成します。
...る Complexクラスのオブジェクトを生成します。
@param r 生成する複素数の絶対値。
@param theta 生成する複素数の偏角。単位はラジアンです。
例:
p Complex.polar(2.0, 0) #=> Complex(2.0, 0.0)
p Complex.polar(2.0, Math::PI) #=> Complex(-2.0... -
Complex
# polar -> Array (18108) -
複素数の極座標表示、すなわち、配列 [self.abs, self.arg] を返します。
...複素数の極座標表示、すなわち、配列 [self.abs, self.arg] を返します。
例:
z = Complex.new(3.0, 4.0)
p z #=> Complex(3.0, 4.0)
p z.polar #=> [5.0, 0.927295218001612]... -
Complex
# angle -> Float (7) -
自身の偏角を[-π,π]の範囲で返します。
...ます。
例:
Complex.polar(3, Math::PI/2).arg # => 1.5707963267948966
非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。
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
[注意]......#=> 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... -
Complex
# arg -> Float (7) -
自身の偏角を[-π,π]の範囲で返します。
...ます。
例:
Complex.polar(3, Math::PI/2).arg # => 1.5707963267948966
非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。
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
[注意]......#=> 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... -
Complex
# phase -> Float (7) -
自身の偏角を[-π,π]の範囲で返します。
...ます。
例:
Complex.polar(3, Math::PI/2).arg # => 1.5707963267948966
非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。
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
[注意]......#=> 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...
