Skip to content

Instantly share code, notes, and snippets.

@yigitserin
Last active July 18, 2016 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yigitserin/0fdaea1a6c6b5412f87781950ab164e1 to your computer and use it in GitHub Desktop.
Save yigitserin/0fdaea1a6c6b5412f87781950ab164e1 to your computer and use it in GitHub Desktop.
coordX = 40.782393
coordY = -73.966601
maxSize = 10
x = 0
y = 0
dx= 0
dy = -1
i = 0
while i < maxSize**2:
if (-maxSize/2 < x <= maxSize/2) and (-maxSize/2 < y <= maxSize/2):
print("{},{}".format((x * 0.0025) + coordX, (y * 0.0025 ) + coordY))
if x == y or (x < 0 and x == -y) or (x > 0 and x == 1-y):
dx, dy = -dy, dx
x, y = x+dx, y+dy
i+=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment