Skip to content

Instantly share code, notes, and snippets.

@tiantian20007
Created March 29, 2012 07:32
Show Gist options
  • Save tiantian20007/2234560 to your computer and use it in GitHub Desktop.
Save tiantian20007/2234560 to your computer and use it in GitHub Desktop.
Get distance between two point
import math
def distance(point1,point2):
"""get distance between 2 point, point: sequence=>x,y
"""
dis = math.sqrt(math.pow(point1[0]-point2[0],2)+math.pow(point1[1]-point2[1],2))
return dis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment