def calc_last_dist_to_goal(self):
        x_goal = self.env.x_goal
        y_goal = self.env.y_goal
        r_goal = self.env.r_goal
        
        last_xf = self.env.last_xf
        last_yf = self.env.last_yf
        
        sqrd_dist_to_goal = ( x_goal - last_xf )**2 + ( y_goal - last_yf )**2 
        temp = np.max([0, sqrd_dist_to_goal - r_goal**2])

        return np.sqrt(temp)
dataset/ETHPy150Open chrisdembia/agent-bicycle/randlov1998/tasks.py/LSPIGotoTask.calc_last_dist_to_goal/original