Advertisement
Nenogzar

Untitled

Nov 21st, 2023
751
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. coordinate_a = list(map(int, input("A: ").split()))
  2. coordinate_b = list(map(int, input("B: ").split()))
  3. coordinate_c = list(map(int, input("C: ").split()))
  4. coordinate_d = list(map(int, input("D: ").split()))
  5.  
  6. # Поправки във формулата
  7. formula = 0.5 * (
  8.     (coordinate_a[0] * coordinate_b[1])
  9.     + (coordinate_b[0] * coordinate_c[1])
  10.     + (coordinate_c[0] * coordinate_d[1])
  11.     + (coordinate_d[0] * coordinate_a[1])
  12.     - (coordinate_b[0] * coordinate_a[1])
  13.     - (coordinate_c[0] * coordinate_b[1])
  14.     - (coordinate_d[0] * coordinate_c[1])
  15.     - (coordinate_a[0] * coordinate_d[1])
  16. )
  17.  
  18. print("Лицето на четириъгълника е:", abs(formula))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement