Home | History | Annotate | Download | only in misc

Lines Matching refs:array

2 # Various array and rectangle tools, but mostly rectangles, hence the
11 def calcBounds(array):
12 """Return the bounding rectangle of a 2D points array as a tuple:
15 if len(array) == 0:
17 xs = [x for x, y in array]
18 ys = [y for x, y in array]
21 def calcIntBounds(array):
22 """Return the integer bounding rectangle of a 2D points array as a
25 xMin, yMin, xMax, yMax = calcBounds(array)
45 def pointsInRect(array, rect):
46 """Find out which points or array are inside rect.
47 Returns an array with a boolean for each point.
49 if len(array) < 1:
52 return [(xMin <= x <= xMax) and (yMin <= y <= yMax) for x, y in array]
59 def asInt16(array):
61 return [int(math.floor(i+0.5)) for i in array]