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> |
<lang haskell>import Data.Tuple.Curry |
||
⚫ | |||
main :: IO () |
|||
putStrLn "" |
|||
main = |
|||
mapM_ putStrLn $ task (-10, 11) (-11, 12) ((3, -5), 3) |
|||
putStrLn |
mapM_ putStrLn $ |
||
concatMap |
|||
⚫ | |||
(("" :) . uncurryN task) |
|||
putStrLn "" |
|||
[ ((-10, 11), (10, -9), ((3, -5), 3)) |
|||
⚫ | |||
putStrLn "" |
|||
, ((3, -2), (7, -2), ((3, -5), 3)) |
|||
⚫ | |||
putStrLn "" |
|||
, ((0, -3), (0, 6), ((0, 0), 4)) |
|||
, ((6, 3), (10, 7), ((4, 2), 5)) |
|||
putStrLn "" |
|||
, ((7, 4), (11, 18), ((4, 2), 5)) |
|||
] |
|||
task :: (Double, Double) |
task :: (Double, Double) |