Advertisement
nanokatka

task4

Feb 2nd, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. a_1=input("Enter coordinates of the center of the circle separated by a delimiter (e.g. 20.55 ; 50.1):")
  2. a_1=a_1.replace(",",".")
  3. a_1=a_1.split(";")
  4. x_0=float(a_1[0])
  5. y_0=float(a_1[1])
  6.  
  7. a_2=input("Enter radius of the circle (e.g. 20.5):")
  8. a_2=a_2.replace(",",".")
  9. r_0=float(a_2)
  10.  
  11. a_3=input("Enter cooredinates of random point separated by a delimiter (e.g. 10.5 ; 3) ")
  12. a_3=a_3.replace(",",".")
  13. a_3=a_3.split(";")
  14. x_1=float(a_3[0])
  15. y_1=float(a_3[1])
  16.  
  17. if ((x_1-x_0)**2+(y_1-y_0)**2-r_0**2) < 0:
  18. print("point is inside circle")
  19. else:
  20. print("outside circle")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement