[Haskell-beginners] How to use trigonometric functions with Data.Scientific?

Martin Vlk martin at vlkk.cz
Wed Jun 3 13:23:45 UTC 2015


David McBride:
> You should be able to use sin (toRealFloat a).  But I imagine that could
> introduce some error into your calculations.  You will have to make sure
> you put enough type signatures to infer Double.
> 

Hi David, many thanks for your reply.
In the end I found the problem was not in precision, but rather a much
more mundane mistake - I failed to notice the trigonometric functions
expect input value in radians, not degrees. Doh! :-)

Now my calculation works as expected.

Thanks again
Martin


More information about the Beginners mailing list