How to call a function within class?
That doesn't work because
distToPoint is inside your class, so you need to prefix it with the classname if you want to refer to it, like this:
classname.distToPoint(self, p). You shouldn't do it like that, though. A better way to do it is to refer to the method directly through the class instance (which is the first argument of a class method), like so: