def volume_of_the_unit_ball(d):
""" Volume of the d-dimensional unit ball.
Parameters
----------
d : int
dimension.
Returns
-------
vol : float
volume.
"""
vol = pi**(d/2) / gamma(d/2+1) # = 2 * pi^(d/2) / ( d*gamma(d/2) )
return vol
评论列表
文章目录