def getAdditionalLoopLength(loop, point, pointIndex):
 afterPoint = loop[pointIndex]
 beforePoint = loop[(((pointIndex + len(loop)) - 1) % len(loop))]
 return ((abs((point - beforePoint)) + abs((point - afterPoint))) - abs((afterPoint - beforePoint)))

def getAdditionalLoopLength ( loop , point , pointIndex ) : afterPoint = loop [ pointIndex ] beforePoint = loop [ ( ( ( pointIndex + len ( loop ) ) - 1 ) % len ( loop ) ) ] return ( ( abs ( ( point - beforePoint ) ) + abs ( ( point - afterPoint ) ) ) - abs ( ( afterPoint - beforePoint ) ) )
get the additional length added by inserting a point into a loop .