Line circle intersection: Difference between revisions

Content added Content deleted
m (→‎{{header|Haskell}}: Applied hlint and hindent (see https://github.com/tibbe/haskell-style-guide))
m (→‎{{header|Haskell}}: One possible consolidation of the main – OP may prefer to revert.)
Line 187: Line 187:
</pre>
</pre>
=={{header|Haskell}}==
=={{header|Haskell}}==
<lang haskell>main = do
<lang haskell>import Data.Tuple.Curry

mapM_ putStrLn $ task (-10, 11) (10, -9) ((3, -5), 3)
main :: IO ()
putStrLn ""
main =
mapM_ putStrLn $ task (-10, 11) (-11, 12) ((3, -5), 3)
putStrLn ""
mapM_ putStrLn $
concatMap
mapM_ putStrLn $ task (3, -2) (7, -2) ((3, -5), 3)
(("" :) . uncurryN task)
putStrLn ""
mapM_ putStrLn $ task (3, -2) (7, -2) ((0, 0), 4)
[ ((-10, 11), (10, -9), ((3, -5), 3))
, ((-10, 11), (-11, 12), ((3, -5), 3))
putStrLn ""
mapM_ putStrLn $ task (0, -3) (0, 6) ((0, 0), 4)
, ((3, -2), (7, -2), ((3, -5), 3))
, ((3, -2), (7, -2), ((0, 0), 4))
putStrLn ""
mapM_ putStrLn $ task (6, 3) (10, 7) ((4, 2), 5)
, ((0, -3), (0, 6), ((0, 0), 4))
, ((6, 3), (10, 7), ((4, 2), 5))
putStrLn ""
mapM_ putStrLn $ task (7, 4) (11, 18) ((4, 2), 5)
, ((7, 4), (11, 18), ((4, 2), 5))
]


task :: (Double, Double)
task :: (Double, Double)