Advertisement
DiYane

Center point

Oct 11th, 2023
815
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. import math
  2.  
  3. def get_distance(_x1, _y1, _x2, _y2):
  4.     return math.sqrt(math.pow(_x2 - _x1, 2.0) + math.pow(_y2 - _y1, 2.0))
  5.  
  6. x1 = math.floor(float(input()))
  7. y1 = math.floor(float(input()))
  8. x2 = math.floor(float(input()))
  9. y2 = math.floor(float(input()))
  10.  
  11. dist1 = get_distance(x1, y1, 0, 0)
  12. dist2 = get_distance(x2, y2, 0, 0)
  13.  
  14. if dist1 <= dist2:
  15.     print(f"({x1}, {y1})")
  16. else:
  17.     print(f"({x2}, {y2})")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement