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