trds

puncte coliniare

Nov 27th, 2020 (edited)
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. def Suntcoliniare (a,b,c):
  2.     if (c[1]- a[1]) / (b[1] - a[1]) == (c[0] - a[0]) / (b[0] - a[0]):
  3.         return True
  4.     else:
  5.         return False
  6.  
  7. def citire():
  8.     x=int(input("Introdu coordonata x:"))
  9.     y=int(input("Introdu coodonata y:"))
  10.     p=(x,y)
  11.     return p
  12.  
  13. a=citire()
  14. print(a)
  15. b=citire()
  16. print(b)
  17. c=citire()
  18.  
  19. x=Suntcoliniare (a,b,c)
  20. print(x)
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
Add Comment
Please, Sign In to add comment