summaryrefslogtreecommitdiff
path: root/photon.py
diff options
context:
space:
mode:
Diffstat (limited to 'photon.py')
-rw-r--r--photon.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/photon.py b/photon.py
index b58a97b..d1574ea 100644
--- a/photon.py
+++ b/photon.py
@@ -17,14 +17,11 @@ def uniform_sphere(size=None):
c = np.sqrt(1-u**2)
- x = c*np.cos(theta)
- y = c*np.sin(theta)
- z = u
-
points = np.empty((x.size, 3))
- points[:,0] = x
- points[:,1] = y
- points[:,2] = z
+
+ points[:,0] = c*np.cos(theta)
+ points[:,1] = c*np.sin(theta)
+ points[:,2] = u
if size is None:
return points[0]