From cb69d2e1c7ced951cbf7a31ee286b0ed92cab8a8 Mon Sep 17 00:00:00 2001 From: rcoh Date: Fri, 18 Feb 2011 16:56:43 -0500 Subject: Adding Epydoc generated docs. --- html/SmootLight.util.Geo-pysrc.html | 154 ++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 html/SmootLight.util.Geo-pysrc.html (limited to 'html/SmootLight.util.Geo-pysrc.html') diff --git a/html/SmootLight.util.Geo-pysrc.html b/html/SmootLight.util.Geo-pysrc.html new file mode 100644 index 0000000..f04b974 --- /dev/null +++ b/html/SmootLight.util.Geo-pysrc.html @@ -0,0 +1,154 @@ + + + + + SmootLight.util.Geo + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package SmootLight :: + Package util :: + Module Geo + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module SmootLight.util.Geo

+
+ 1  #Geometry code 
+ 2  import math 
+ 3  from bisect import * 
+ 4  import random 
+
5 -def pointWithinBoundingBox(point, bb): +
6 """Returns whether or not a point (x,y) is within a bounding box (xmin, ymin, xmax, ymax)""" + 7 return all([(point[i % 2] <= bb[i]) == (i>1) for i in range(4)]) + 8 +
9 -def addLocations(l1,l2): +
10 return tuple([l1[i]+l2[i] for i in range(len(l1))]) +
11 +
12 -def gaussian(x,height,center,width): +
13 a=height +14 b=center +15 c=width +16 return a*math.exp(-((x-b)**2)/(2*c**2)) +
17 +
18 -def dist(l1, l2): +
19 return math.sqrt((l1[0]-l2[0])**2+(l1[1]-l2[1])**2) #For speed +
20 +
21 -def randomLoc(boundingBox): #TODO: make less shitty +
22 loc = [] +23 loc.append(random.randint(0, boundingBox[0])) +24 loc.append(random.randint(0, boundingBox[1])) +25 return tuple(loc) +26 +
27 -def approxexp(x): +
28 """Approximates exp with a 3 term Taylor Series.""" +29 return 1+x+x**2/2+x**3/6 +
30 +
31 -def windtrail(x,y,height,center,width): +
32 a=height +33 b=center +34 c=width +35 return a*((math.exp(-((x-b))/(c)))**2)*(math.exp(-((y))/(0.2*c)))**2 +
36 +
37 -class Location(object): +
38 - def __init__(self,x=0,y=0): +
39 self.x = x +40 self.y = y +
41 - def __add__(self, b): +
42 return Location(self.x+b.x, self.y+b.y) +
43 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + -- cgit v1.2.3