def calc_dist_to_goal(self):
        # ported from Randlov's C code. See bike.c for the source
        # code.

        # unpack variables
        x_goal = self.x_goal
        y_goal = self.y_goal
        r_goal = self.r_goal
        xf = self.env.getXF()
        yf = self.env.getYF()

        sqrd_dist_to_goal = ( x_goal - xf )**2 + ( y_goal -yf )**2 
        temp = np.max([0, r_goal**2 - sqrd_dist_to_goal])

        # We probably don't need to actually compute a sqrt here if it
        # helps simulation speed.
        temp = np.sqrt(temp)

        return temp
dataset/ETHPy150Open chrisdembia/agent-bicycle/randlov1998/tasks_gotorewards.py/LinearFATileCoding3456GoToTask.calc_dist_to_goal/swapped operands of `-`