def dist_sq ( self , other ) : dx = self . x - other . x dy = self . y - other . y return dx ** 2 + dy ** 2
python distance of two points
Distance squared to some other point .
def dist_sq(self, other):
    """Distance squared to some other point."""
    dx = self.x - other.x
    dy = self.y - other.y
    return dx**2 + dy**2