recursiveFunc :: All -> [Point] -> Double -> Range -> Range -> Point -> Point -> Int -> Int -> (Point, Bool, Range)
recursiveFunc all srcContours epsi slice right_slice start_pt end_pt pos count
        | dx == 0 && dy == 0 = (srcContours !! (head slice), True, [-1, -1])
        | pos /= last slice  = (start_pt, le_eps, (fst range_dist))
        | otherwise          = (srcContours !! (head slice), True, right_slice)
        where 
                dx         = dxFunc end_pt start_pt
                dy         = dyFunc end_pt start_pt
                max_dist   = 0
                range_dist = secondRecursiveFunc srcContours count dx dy max_dist pos slice right_slice start_pt
                newDis     = snd range_dist 
                le_eps     = fromIntegral (newDis * newDis) <= epsi * fromIntegral (dx * dx + dy * dy)
recursiveFunc :: All -> [Point] -> Double -> Range -> Range -> Point -> Point -> Int -> Int -> (Point, Bool, Range)
recursiveFunc all srcContours epsi slice right_slice start_pt end_pt pos count
        | dx == 0 && dy == 0 = (srcContours !! (head slice), True, [-1, -1])
        | pos /= last slice  = (start_pt, le_eps, (fst range_dist))
        | otherwise          = (srcContours !! (head slice), True, right_slice)
        where 
                dx         = dxFunc end_pt start_pt
                dy         = dyFunc end_pt start_pt
                max_dist   = 0
                range_dist = secondRecursiveFunc srcContours count dx dy max_dist pos slice right_slice start_pt
                newDis     = snd range_dist 
                le_eps     = fromIntegral (newDis * newDis) <= epsi * fromIntegral (dx * dx + dy * dy)
recursiveFunc all srcContours epsi slice right_slice start_pt end_pt pos count
        | dx == 0 && dy == 0 = (srcContours !! (head slice), True, [-1, -1])
        | pos /= last slice  = (start_pt, le_eps, (fst range_dist))
        | otherwise          = (srcContours !! (head slice), True, right_slice)
        where 
                dx         = dxFunc end_pt start_pt
                dy         = dyFunc end_pt start_pt
                max_dist   = 0
                range_dist = secondRecursiveFunc srcContours count dx dy max_dist pos slice right_slice start_pt
                newDis     = snd range_dist 
                le_eps     = fromIntegral (newDis * newDis) <= epsi * fromIntegral (dx * dx + dy * dy)