def closestPoint(self, pos):
    minDistance = None
    for i in range(self.resolution):
        t = (i / self.resolution)
        point = self.getPoint(t)
        d = ((((pos.x - point.x) ** 2) + ((pos.y - point.y) ** 2)) ** 0.5)
        if ((minDistance == None) or (d < minDistance)):
            minDistance = d
            result = point
    return result
def closestPoint(self, pos):
    minDistance = None
    for i in range(self.resolution):
        t = (i / self.resolution)
        point = self.getPoint(t)
        d = ((((pos.x - point.x) ** 2) + ((pos.y - point.y) ** 2)) ** 0.5)
        if ((minDistance == None) or (d < minDistance)):
            minDistance = d
            result = point
    return result