aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/cone-vector.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/contrib/cone-vector.py b/contrib/cone-vector.py
index 6526817..85c2c49 100644
--- a/contrib/cone-vector.py
+++ b/contrib/cone-vector.py
@@ -38,10 +38,9 @@ def solid_angle_fraction2planar_angle (solid_angle_fraction, dim):
alpha = (dim - 1) / 2
beta = 1/2
if solid_angle_fraction < 1/2:
- planar_angle = betaincinv(alpha, beta, 2*solid_angle_fraction)
+ return arcsin(sqrt(betaincinv(alpha, beta, 2*solid_angle_fraction)))
else:
- planar_angle = betaincinv(alpha, beta, 2*(1-solid_angle_fraction))
- return arcsin(sqrt(planar_angle))
+ return pi - arcsin(sqrt(betaincinv(alpha, beta, 2*(1-solid_angle_fraction))))
def rotate_from_nth_canonical (x, axis):
xn = x[-1]