From 870236b3c4950762a73247c68023a8dee6e14a7b Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Sun, 12 Jun 2011 21:31:22 -0400 Subject: added some fun models; added some untested code to implement absorption, scattering, reflection, and refraction --- photon.py | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 photon.py (limited to 'photon.py') diff --git a/photon.py b/photon.py deleted file mode 100644 index b494384..0000000 --- a/photon.py +++ /dev/null @@ -1,29 +0,0 @@ -import numpy as np - -def uniform_sphere(size=None, dtype=np.double): - """ - Generate random points isotropically distributed across the unit sphere. - - Args: - - size: int, *optional* - Number of points to generate. If no size is specified, a single - point is returned. - - Source: Weisstein, Eric W. "Sphere Point Picking." Mathworld. - """ - - theta, u = np.random.uniform(0.0, 2*np.pi, size), \ - np.random.uniform(-1.0, 1.0, size) - - c = np.sqrt(1-u**2) - - if size is None: - return np.array([c*np.cos(theta), c*np.sin(theta), u]) - - points = np.empty((size, 3), dtype) - - points[:,0] = c*np.cos(theta) - points[:,1] = c*np.sin(theta) - points[:,2] = u - - return points -- cgit