Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- coordinate_a = list(map(int, input("A: ").split()))
- coordinate_b = list(map(int, input("B: ").split()))
- coordinate_c = list(map(int, input("C: ").split()))
- coordinate_d = list(map(int, input("D: ").split()))
- # Поправки във формулата
- formula = 0.5 * (
- (coordinate_a[0] * coordinate_b[1])
- + (coordinate_b[0] * coordinate_c[1])
- + (coordinate_c[0] * coordinate_d[1])
- + (coordinate_d[0] * coordinate_a[1])
- - (coordinate_b[0] * coordinate_a[1])
- - (coordinate_c[0] * coordinate_b[1])
- - (coordinate_d[0] * coordinate_c[1])
- - (coordinate_a[0] * coordinate_d[1])
- )
- print("Лицето на четириъгълника е:", abs(formula))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement