aboutsummaryrefslogtreecommitdiff
path: root/src/sambal/sambal.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/sambal/sambal.py')
-rw-r--r--src/sambal/sambal.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sambal/sambal.py b/src/sambal/sambal.py
index 8e57cca..fbb2025 100644
--- a/src/sambal/sambal.py
+++ b/src/sambal/sambal.py
@@ -21,7 +21,7 @@ from numpy.random import randn, random
from numpy.linalg import norm
from scipy.special import betainc, betaincinv
-def random_vector_on_sphere(dim):
+def random_on_sphere(dim):
"""Return a random vector uniformly distributed on the unit sphere."""
x = randn(dim)
return x / norm(x)
@@ -78,7 +78,7 @@ def random_vector_on_disk(axis, planar_angle):
disk."""
dim = axis.size
x = empty(dim)
- x[:-1] = sin(planar_angle) * random_vector_on_sphere(dim - 1)
+ x[:-1] = sin(planar_angle) * random_on_sphere(dim - 1)
x[-1] = cos(planar_angle)
return rotate_from_nth_canonical(x, axis)