(self)
Refreshes bezier curve according to start and end.
        It uses the arctan to force the bèzier curve always going a bit
        forward before drifting.
Refreshes bezier curve according to start and end.
        It uses the arctan to force the bèzier curve always going a bit
        forward before drifting.
Refreshes bezier curve according to start and end . It uses the arctan to force the bèzier curve always going a bit forward before drifting .
def _rebezier(self):
        """ Refreshes bezier curve according to start and end.
        It uses the arctan to force the bèzier curve always going a bit
        forward before drifting."""
        arc_tan = np.arctan2(self.bez_start[1] - self.bez_end[1],
                             self.bez_start[0] - self.bez_end[0])
        abs_angle = np.abs(np.degrees(arc_tan))
        # We use the angle value plus a fixed amount to steer the line a bit
        start_right = [self.bez_start[0] - 5 - 0.6 * abs_angle,
                       self.bez_start[1]]
        end_left = [self.bez_end[0] + 5 + 0.6 * abs_angle, self.bez_end[1]]
        # Y distance to mid point
        dist = (min(self.bez_start[0], self.bez_end[0]) +
                abs(self.bez_start[0] - self.bez_end[0]) / 2)
        # This updates the bèzier curve graphics
        self.lin.bezier = (self.bez_start + start_right +
                           [dist, self.bez_start[1]] + [dist, self.bez_end[1]] +
                           end_left + self.bez_end)
def _rebezier ( self ) : arc_tan = np . arctan2 ( self . bez_start [ 1 ] - self . bez_end [ 1 ] , self . bez_start [ 0 ] - self . bez_end [ 0 ] ) abs_angle = np . abs ( np . degrees ( arc_tan ) ) # We use the angle value plus a fixed amount to steer the line a bit start_right = [ self . bez_start [ 0 ] - 5 - 0.6 * abs_angle , self . bez_start [ 1 ] ] end_left = [ self . bez_end [ 0 ] + 5 + 0.6 * abs_angle , self . bez_end [ 1 ] ] # Y distance to mid point dist = ( min ( self . bez_start [ 0 ] , self . bez_end [ 0 ] ) + abs ( self . bez_start [ 0 ] - self . bez_end [ 0 ] ) / 2 ) # This updates the bèzier curve graphics self . lin . bezier = ( self . bez_start + start_right + [ dist , self . bez_start [ 1 ] ] + [ dist , self . bez_end [ 1 ] ] + end_left + self . bez_end )