Angle difference between two bearings: Difference between revisions

Content added Content deleted
m (→‎{{header|Haskell}}: (layout, function name, narrowed import))
m (→‎{{header|Haskell}}: ( applicative inlining of row display function ))
Line 216: Line 216:
main =
main =
mapM_ putStrLn $
mapM_ putStrLn $
uncurry
displayRow <$>
(((<*>) . printf "%6.2f° + %6.2f° -> %7.2f°") <*> angleBetweenDegrees) <$>
[ (20.0, 45.0)
[ (20.0, 45.0)
, (-45.0, 45.0)
, (-45.0, 45.0)
Line 223: Line 224:
, (-45.0, 125.0)
, (-45.0, 125.0)
, (-45.0, 145.0)
, (-45.0, 145.0)
]
]</lang>
where
displayRow (x, y) =
printf "%6.2f° + %6.2f° -> %7.2f°" x y $ angleBetweenDegrees x y</lang>
{{Out}}
{{Out}}
<pre> 20.00° + 45.00° -> 25.00°
<pre> 20.00° + 45.00° -> 25.00°