def getAdditionalLength(path, point, pointIndex):
 if (pointIndex == 0):
  return abs((point - path[0]))
 if (pointIndex == len(path)):
  return abs((point - path[(-1)]))
 return ((abs((point - path[(pointIndex - 1)])) + abs((point - path[pointIndex]))) - abs((path[pointIndex] - path[(pointIndex - 1)])))

def getAdditionalLength ( path , point , pointIndex ) : if ( pointIndex == 0 ) : return abs ( ( point - path [ 0 ] ) ) if ( pointIndex == len ( path ) ) : return abs ( ( point - path [ ( - 1 ) ] ) ) return ( ( abs ( ( point - path [ ( pointIndex - 1 ) ] ) ) + abs ( ( point - path [ pointIndex ] ) ) ) - abs ( ( path [ pointIndex ] - path [ ( pointIndex - 1 ) ] ) ) )
get the additional length added by inserting a point into a path .