るりまサーチ

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

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n=
  3. rsa n
  4. openssl n
  5. pop n_mails

ライブラリ

クラス

キーワード

検索結果

Numeric#polar -> [Numeric, Numeric] (27432.0)

自身の絶対値と偏角を配列にして返します。正の数なら [self, 0]、負の数な ら [-self, Math::PI] を返します。

...正の数なら [self, 0]、負の数な
ら [-self, Math::PI] を返します。

//emlist[例][ruby]{
1.0.polar # => [1.0, 0]
2.0.polar # => [2.0, 0]
-1.0.polar # => [1.0, 3.141592653589793]
-2.0.polar # => [2.0, 3.141592653589793]
//}

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

@see Complex#polar...

Complex#polar -> [Numeric, Numeric] (24420.0)

自身の絶対値と偏角を配列にして返します。

...自身の絶対値と偏角を配列にして返します。

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

@see Numeric#polar...

Complex#angle -> Float (12207.0)

自身の偏角を[-π,π]の範囲で返します。

...mplex.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#arg -> Float (9107.0)

自身の偏角を[-π,π]の範囲で返します。

...mplex.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 (9107.0)

自身の偏角を[-π,π]の範囲で返します。

...mplex.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...

絞り込み条件を変える