# --------------------------------- # File: Xiang/distance.py # Author: Mihaela Malita # distance(P1,P2) computes the distance between two points in 2D # Xiang Appendix I # print sqrt( 49 ) # OR x**1/2==the square root of x # --------------------------------- from math import sqrt def main(): x1=-1 y1=2 x2=3 y2=5 d = sqrt((x2-x1)**2 + (y2-y1)**2) print "distance P1(-1,2) and P2(3,5) is %d " % d main()