Back to page
Print
create a new page, using
Python/円周率
as a template. ::
NJF Wiki
xpwiki
:create a new page, using Python/円周率 as a template.
Start:
Pythonで円周率を使うにはmath.piを使います。ver.2系,ver.3...
>>> import math
>>> math.pi
結果
3.141592653589793
numpyが入っていれば、numpy.piも使えます。
>>> import numpy
>>> numpy.pi
結果
3.141592653589793
ver.3.6からは円周率の二倍であるmath.tauが加わりました。
>>> import math
>>> math.tau
結果
6.283185307179586
End:
Pythonで円周率を使うにはmath.piを使います。ver.2系,ver.3...
>>> import math
>>> math.pi
結果
3.141592653589793
numpyが入っていれば、numpy.piも使えます。
>>> import numpy
>>> numpy.pi
結果
3.141592653589793
ver.3.6からは円周率の二倍であるmath.tauが加わりました。
>>> import math
>>> math.tau
結果
6.283185307179586
Page: