Advertisement
Guest User

task1

a guest
Mar 29th, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. import math
  2. class Circle():
  3.     def inside(self, x1, y1, x2, y2, radius):
  4.         self.x1 = x1
  5.         self.y1 = y1
  6.         self.x2 = x2
  7.         self.y2 = y2
  8.         self.radius = radius
  9.         self.length = math.sqrt((self.x2 - self.x1) ** 2 + (self.y2 - self.y1) ** 2)
  10.         if self.length < self.radius:
  11.             return True
  12.         else:
  13.             return False
  14.  
  15. circle1 = Circle()
  16. x1 = int(input("Введите x центра"))
  17. y1 = int(input("Введите y центра"))
  18. radius = int(input("Введите радиус"))
  19.  
  20. for i in range(1,4):
  21.     x2 = int(input("Введите x точки " + str(i)))
  22.     y2 = int(input("Введите y точки " + str(i)))
  23.     print(circle1.inside(x1, y1, x2, y2, radius))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement