Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a_1=input("Enter coordinates of the center of the circle separated by a delimiter (e.g. 20.55 ; 50.1):")
- a_1=a_1.replace(",",".")
- a_1=a_1.split(";")
- x_0=float(a_1[0])
- y_0=float(a_1[1])
- a_2=input("Enter radius of the circle (e.g. 20.5):")
- a_2=a_2.replace(",",".")
- r_0=float(a_2)
- a_3=input("Enter cooredinates of random point separated by a delimiter (e.g. 10.5 ; 3) ")
- a_3=a_3.replace(",",".")
- a_3=a_3.split(";")
- x_1=float(a_3[0])
- y_1=float(a_3[1])
- if ((x_1-x_0)**2+(y_1-y_0)**2-r_0**2) < 0:
- print("point is inside circle")
- else:
- print("outside circle")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement