-- | Helper function to check that a reference points' sign is equal
-- to other points. Intended to be used together with foldl
checkSign :: Point -> Bool -> (Point, Point) -> Bool
checkSign (x, y) b ((x', y'), (x'', y'')) =
  b && hasSameSign x x' x'' && hasSameSign y y' y''
  where
    hasSameSign x y z
      | x >= 0 && y >= 0 && z >= 0 = True
      | x < 0 && y < 0 && z < 0    = True
      | otherwise                  = False                                     
   
-- | Helper function to check that the distance between two points are
-- equal to a reference distance
checkSign :: Point -> Bool -> (Point, Point) -> Bool
checkSign (x, y) b ((x', y'), (x'', y'')) =
  b && hasSameSign x x' x'' && hasSameSign y y' y''
  where
    hasSameSign x y z
      | x >= 0 && y >= 0 && z >= 0 = True
      | x < 0 && y < 0 && z < 0    = True
      | otherwise                  = False                                     
   
-- | Helper function to check that the distance between two points are
-- equal to a reference distance
checkSign (x, y) b ((x', y'), (x'', y'')) =
  b && hasSameSign x x' x'' && hasSameSign y y' y''
  where
    hasSameSign x y z
      | x >= 0 && y >= 0 && z >= 0 = True
      | x < 0 && y < 0 && z < 0    = True
      | otherwise                  = False                                     
   
-- | Helper function to check that the distance between two points are
-- equal to a reference distance