def getJumpPointIfInside(boundary, otherPoint, perimeterWidth, runningJumpSpace):
 insetBoundary = intercircle.getSimplifiedInsetFromClockwiseLoop(boundary, (- perimeterWidth))
 closestJumpDistanceIndex = euclidean.getClosestDistanceIndexToLine(otherPoint, insetBoundary)
 jumpIndex = ((closestJumpDistanceIndex.index + 1) % len(insetBoundary))
 jumpPoint = euclidean.getClosestPointOnSegment(insetBoundary[closestJumpDistanceIndex.index], insetBoundary[jumpIndex], otherPoint)
 jumpPoint = getJumpPoint(jumpPoint, otherPoint, boundary, runningJumpSpace)
 if euclidean.isPointInsideLoop(boundary, jumpPoint):
  return jumpPoint
 return None

def getJumpPointIfInside ( boundary , otherPoint , perimeterWidth , runningJumpSpace ) : insetBoundary = intercircle . getSimplifiedInsetFromClockwiseLoop ( boundary , ( - perimeterWidth ) ) closestJumpDistanceIndex = euclidean . getClosestDistanceIndexToLine ( otherPoint , insetBoundary ) jumpIndex = ( ( closestJumpDistanceIndex . index + 1 ) % len ( insetBoundary ) ) jumpPoint = euclidean . getClosestPointOnSegment ( insetBoundary [ closestJumpDistanceIndex . index ] , insetBoundary [ jumpIndex ] , otherPoint ) jumpPoint = getJumpPoint ( jumpPoint , otherPoint , boundary , runningJumpSpace ) if euclidean . isPointInsideLoop ( boundary , jumpPoint ) : return jumpPoint return None
get the jump point if it is inside the boundary .