math
組み込み関数
abs( -1 )
d, m = divmod( 10, 3 )
pow( 2, 10 )
round( 1.23 )
round( 1.23, 1 )
標準ライブラリ
import math;
math.cos( math.pi );
math.sin( math.pi );
math.degrees( math.pi )
math.radians( math.pi )
import random
random.random()
WARNING
i = 0
i += 1
numeric(数値演算)
REF
http://pypi.python.org/pypi/Numeric/24.2(numeric)
ベクトル
v = numpy.array( (2.0, 2.0, 1.0) )
l = numpy.linalg.norm(v)
numpy.dot(v1,v2)
numpy.cross(v1,v2)
行列
m = numpy.matrix( (
(2.0, 0.0, 10),
(0.0, 3.0, 10),
(0.0, 3.0, 10),
) )
print ( a.I )
print ( a.T )
numpy.linalg.det(a)
ret = numpy.dot(mat,v)
ret = m * m;