66件ヒット
[1-66件を表示]
(0.020秒)
種類
- インスタンスメソッド (55)
- クラス (11)
検索結果
先頭5件
-
Complex
# magnitude -> Numeric (36125.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
# abs -> Numeric (21025.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... -
Vector
# magnitude -> Float (18107.0) -
ベクトルの大きさ(ノルム)を返します。
...ベクトルの大きさ(ノルム)を返します。
//emlist[例][ruby]{
require 'matrix'
Vector[3, 4].norm # => 5.0
Vector[Complex(0, 1), 0].norm # => 1.0
//}
@see Vector#normalize... -
Vector
# norm -> Float (3007.0) -
ベクトルの大きさ(ノルム)を返します。
...ベクトルの大きさ(ノルム)を返します。
//emlist[例][ruby]{
require 'matrix'
Vector[3, 4].norm # => 5.0
Vector[Complex(0, 1), 0].norm # => 1.0
//}
@see Vector#normalize... -
Vector
# r -> Float (3007.0) -
ベクトルの大きさ(ノルム)を返します。
...ベクトルの大きさ(ノルム)を返します。
//emlist[例][ruby]{
require 'matrix'
Vector[3, 4].norm # => 5.0
Vector[Complex(0, 1), 0].norm # => 1.0
//}
@see Vector#normalize... -
Numeric (60.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...by 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
Numeric Integer Fixnum Bignum Float Rational Complex
-------------------------------------------------------------------------------------------
% | o......o o o - -
Numeric Integer Fixnum Bignum Float Rational Complex
-------------------------------------------------------------------------------------------
<< | -......- - - - -
magnitude | o - o o o - o
Numeric Integer Fixnum Bignum Float Rational Complex
--------------------------------------......い。
=> ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin15]
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
% | o o o......< | - o o - -
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
<< | - o -......- -
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
magnitude | o o o o o
modulo | o...