def SquareRoot (N):
Guess = N / 2.0
Quotient = N / Guess
NewGuess = (Guess + Quotient) / 2.0
while (abs(Guess - NewGuess) > 1.0e-15):
#print (Guess, NewGuess)
Guess = NewGuess
Quotient = N / Guess
NewGuess = (Guess + Quotient) / 2.0
return NewGuess
def Distance (X1,Y1,X2,Y2):
A = X2 - X1
B = Y2 - Y1
return SquareRoot(A*A + B*B)