두 좌표 사이의 거리를 계산하는 코드가 있습니다. 두 함수는 모두 같은 클래스 내에 있습니다.클래스 내의 파이썬 호출 함수
그러나 함수 distToPoint
을 함수 isNear
에 어떻게 호출합니까?
def distToPoint(self, p):
"""
Use pythagoras to find distance
(a^2 = b^2 + c^2)
"""
...
def isNear(self, p):
distToPoint(self, p)
...
시도 : self.distToPoint (P) – momeara