You are on page 1of 1

from math import sqrt

flag = ""
while flag == "":

A1 = float(input("X1= "))
A2 = float(input("Y1= "))

B1 = float(input("X2= "))
B2 = float(input("Y2= "))

X = (A1+B1)/2
Y = (A2+B2)/2
print("Midpoint: ", X,",",Y)

M = (B2 - A2) / (B1 - A1)


print("Gradient: ", M)

C = Y - (M*X)
print("c",C)

x = abs(B1 - A1)
y = abs(B2 - A2)
L = sqrt(X**2 + Y**2)
print("Length of line",L)

print("Line: ", 'y = ', M,'x+',C)


flag = str(input("new?"))

You might also like