1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
{-# LANGUAGE TypeSynonymInstances #-}
module Foundation.Math.Trigonometry
( Trigonometry(..)
) where
import Basement.Compat.Base
import qualified Prelude
-- | Method to support basic trigonometric functions
class Trigonometry a where
-- | the famous pi value
pi :: a
-- | sine
sin :: a -> a
-- | cosine
cos :: a -> a
-- | tan
tan :: a -> a
-- | sine-1
asin :: a -> a
-- | cosine-1
acos :: a -> a
-- | tangent-1
atan :: a -> a
-- | hyperbolic sine
sinh :: a -> a
-- | hyperbolic cosine
cosh :: a -> a
-- | hyperbolic tangent
tanh :: a -> a
-- | hyperbolic sine-1
asinh :: a -> a
-- | hyperbolic cosine-1
acosh :: a -> a
-- | hyperbolic tangent-1
atanh :: a -> a
instance Trigonometry Float where
pi = Prelude.pi
sin = Prelude.sin
cos = Prelude.cos
tan = Prelude.tan
asin = Prelude.asin
acos = Prelude.acos
atan = Prelude.atan
sinh = Prelude.sinh
cosh = Prelude.cosh
tanh = Prelude.tanh
asinh = Prelude.asinh
acosh = Prelude.acosh
atanh = Prelude.atanh
instance Trigonometry Double where
pi = Prelude.pi
sin = Prelude.sin
cos = Prelude.cos
tan = Prelude.tan
asin = Prelude.asin
acos = Prelude.acos
atan = Prelude.atan
sinh = Prelude.sinh
cosh = Prelude.cosh
tanh = Prelude.tanh
asinh = Prelude.asinh
acosh = Prelude.acosh
atanh = Prelude.atanh
|