Code Library
Home Submit Free Hosting Link To Us Contacts

Python Compute distance between two points

Python Compute distance between two points Python Python Compute distance between two points Download (.zip)



#a function that computes the distance between two points,
# But does it in a naughty way.

import math

def distance(a,b):
    a[0]=a[0]-b[0]
    a[1]=a[1]-b[1]
    return math.sqrt(a[0]**2+a[1]**2)






Tatet