Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
352 B
3
Indexable
Never
x1 = int(input("Masukkan koordinat :"))
y1 = int(input("Masukkan koordinat :"))
x2 = int(input("Masukkan koordinat :"))
y2 = int(input("Masukkan koordinat: "))

#x1 == x2 = horizontal
# gradien == 0 = horizontal

gradien = (y2-y1) / (x2-x1)

if (x1 == x2) :
    print ("vertical")
elif(gradien == 0) :
    print("horizontal")
else : 
    print(gradien)