Advertisement
Guest User

Untitled

a guest
Dec 21st, 2024
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. import math
  2.  
  3. def result_coord(co_a1, co_b1, co_a2, co_b2):
  4.     distance1 = math.sqrt(co_a1 ** 2 + co_b1 ** 2)
  5.     distance2 = math.sqrt(co_a2 ** 2 + co_b2 ** 2)
  6.     if distance1 <= distance2:
  7.         result = f"({math.floor(co_a1)}, {math.floor(co_b1)})"
  8.     else:
  9.         result = f"({math.floor(co_a2)}, {math.floor(co_b2)})"
  10.     return result
  11.  
  12. co_x1 = float(input())
  13. co_y1 = float(input())
  14. co_x2 = float(input())
  15. co_y2 = float(input())
  16. print(result_coord(co_x1, co_y1, co_x2, co_y2))
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement