so I'm trying to check if a Point is located inside a Circle. I created these 2 classes:
class Point:
def __init__(self, x: int, y: int):
self.x = x
self.y = y
class Circle:
def __init__(self, center, radius):
self.center = Point(x,y)
self.radius = radius
now I have this function:
def in_circle(circle: Circle, point: Point) -> bool:
My thinking was that when the distance between the Point and the center is higher than the radius, it has to be outside the circle. My question now is how I can get the distance between the Point(x,y) and the center. Logically I think I can solve the problem by using Pythagoras, but my problem is that I just started Python and don't understand the syntax so well. Thanks in advance.