Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -47,8 +47,8 @@ def ispointinside(p, poly):
for edge in poly.edges ))
def polypp(poly):
print "\n Polygon(name='%s', edges=(" % poly.name
print ' ', ',\n '.join(str(e) for e in poly.edges) + '\n ))'
print ("\n Polygon(name='%s', edges=(" % poly.name)
print (' ', ',\n '.join(str(e) for e in poly.edges) + '\n ))')
if __name__ == '__main__':
polys = [
@ -91,12 +91,12 @@ if __name__ == '__main__':
Pt(x=10, y=5), Pt(x=8, y=5),
Pt(x=10, y=10))
print "\n TESTING WHETHER POINTS ARE WITHIN POLYGONS"
print ("\n TESTING WHETHER POINTS ARE WITHIN POLYGONS")
for poly in polys:
polypp(poly)
print ' ', '\t'.join("%s: %s" % (p, ispointinside(p, poly))
for p in testpoints[:3])
print ' ', '\t'.join("%s: %s" % (p, ispointinside(p, poly))
for p in testpoints[3:6])
print ' ', '\t'.join("%s: %s" % (p, ispointinside(p, poly))
for p in testpoints[6:])
print (' ', '\t'.join("%s: %s" % (p, ispointinside(p, poly))
for p in testpoints[:3]))
print (' ', '\t'.join("%s: %s" % (p, ispointinside(p, poly))
for p in testpoints[3:6]))
print (' ', '\t'.join("%s: %s" % (p, ispointinside(p, poly))
for p in testpoints[6:]))