From e502db575fe706fc2d987807bacacc430114a171 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 26 Mar 2021 14:05:59 +0530 Subject: Rename random_vector_on_sphere to random_on_sphere. * src/sambal/sambal.py (random_vector_on_sphere): Rename to random_on_sphere. (random_vector_on_disk): Call random_on_sphere instead of random_vector_on_sphere. --- src/sambal/sambal.py | 4 ++-- 1 file 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) -- cgit v1.2.3