From 6a0f16d7b2f1b9f441048ef8d81c10d6866e68ab Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 10 Mar 2021 17:04:06 +0530 Subject: 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. --- contrib/cone-vector.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'contrib') 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: -- cgit v1.2.3