about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2021-03-10 17:04:06 +0530
committerArun Isaac2021-03-10 17:04:06 +0530
commit6a0f16d7b2f1b9f441048ef8d81c10d6866e68ab (patch)
tree13d15b0c75e3f1988e2e48f7b9a47ea441089126
parenta98e485f24dd6adfa431d38ec34a58b5546a4df0 (diff)
downloadnsmc-6a0f16d7b2f1b9f441048ef8d81c10d6866e68ab.tar.gz
nsmc-6a0f16d7b2f1b9f441048ef8d81c10d6866e68ab.tar.lz
nsmc-6a0f16d7b2f1b9f441048ef8d81c10d6866e68ab.zip
Remove surface area computation.
Now that we are computing solid angle fractions, there is no need to
compute the total surface area of the sphere.

* contrib/cone-vector.py (surface_area_of_ball): Delete function.
(solid_angle_fraction2planar_angle): Remove surface area computation.
-rw-r--r--contrib/cone-vector.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/contrib/cone-vector.py b/contrib/cone-vector.py
index 6effe53..16d1dfa 100644
--- a/contrib/cone-vector.py
+++ b/contrib/cone-vector.py
@@ -25,9 +25,6 @@ def random_vector_on_sphere (dim):
     x = randn(dim)
     return x / norm(x)
 
-def surface_area_of_ball (dim):
-    return 2 * pi**(dim/2) / gamma(dim/2)
-
 def planar_angle2solid_angle_fraction (planar_angle, dim):
     alpha = (dim - 1) / 2
     beta = 1/2
@@ -40,7 +37,6 @@ def planar_angle2solid_angle_fraction (planar_angle, dim):
 def solid_angle_fraction2planar_angle (solid_angle_fraction, dim):
     alpha = (dim - 1) / 2
     beta = 1/2
-    sn = surface_area_of_ball(dim)
     if solid_angle_fraction < 1/2:
         planar_angle = betaincinv(alpha, beta, 2*solid_angle_fraction)
     else: