{-# OPTIONS_GHC -Wno-name-shadowing #-}
module Chapter02 where
f :: Floating a => a -> a
f :: forall a. Floating a => a -> a
f a
x = forall a. Floating a => a -> a
sqrt (a
1 forall a. Num a => a -> a -> a
+ a
x)
stdGravityMPS2 :: Double
stdGravityMPS2 :: Double
stdGravityMPS2 = Double
9.80665
yRock30 :: Double -> Double
yRock30 :: Double -> Double
yRock30 Double
t = Double
0.5 forall a. Num a => a -> a -> a
* (-Double
stdGravityMPS2) forall a. Num a => a -> a -> a
* Double
t forall a. Floating a => a -> a -> a
** Double
2 forall a. Num a => a -> a -> a
+ Double
30 forall a. Num a => a -> a -> a
* Double
t
vRock30 :: Double -> Double
vRock30 :: Double -> Double
vRock30 Double
t = Double
30 forall a. Num a => a -> a -> a
- Double
stdGravityMPS2 forall a. Num a => a -> a -> a
* Double
t
sinDeg :: Double -> Double
sinDeg :: Double -> Double
sinDeg Double
deg = forall a. Floating a => a -> a
sin (Double
deg forall a. Num a => a -> a -> a
* forall a. Floating a => a
pi forall a. Fractional a => a -> a -> a
/ Double
180)
f25 :: Double -> Double
f25 :: Double -> Double
f25 Double
x = Double
x forall a. Floating a => a -> a -> a
** (Double
1 forall a. Fractional a => a -> a -> a
/ Double
3)
g :: Double -> Double
g :: Double -> Double
g Double
ɣ = forall a. Floating a => a -> a
exp Double
ɣ forall a. Num a => a -> a -> a
+ Double
8 forall a. Floating a => a -> a -> a
** Double
ɣ
h :: Double -> Double
h :: Double -> Double
h Double
x = Double
1 forall a. Fractional a => a -> a -> a
/ forall a. Floating a => a -> a
sqrt ((Double
x forall a. Num a => a -> a -> a
- Double
5) forall a. Floating a => a -> a -> a
** Double
2 forall a. Num a => a -> a -> a
+ Double
16)
ɣ :: Double -> Double
ɣ :: Double -> Double
ɣ Double
β = Double
1 forall a. Fractional a => a -> a -> a
/ forall a. Floating a => a -> a
sqrt (Double
1 forall a. Num a => a -> a -> a
- Double
β forall a. Floating a => a -> a -> a
** Double
2)
bigU :: Double -> Double
bigU :: Double -> Double
bigU Double
x = (Double
1 forall a. Fractional a => a -> a -> a
/ (Double
10 forall a. Num a => a -> a -> a
- Double
x)) forall a. Num a => a -> a -> a
+ (Double
1 forall a. Fractional a => a -> a -> a
/ (Double
10 forall a. Num a => a -> a -> a
- Double
x))
bigL :: Double -> Double
bigL :: Double -> Double
bigL Double
l = forall a. Floating a => a -> a
sqrt (Double
l forall a. Num a => a -> a -> a
* (Double
l forall a. Num a => a -> a -> a
+ Double
1))
bigEx :: Double -> Double
bigEx :: Double -> Double
bigEx Double
x = Double
1 forall a. Fractional a => a -> a -> a
/ forall a. Num a => a -> a
abs Double
x forall a. Floating a => a -> a -> a
** Double
3
bigEz :: Double -> Double
bigEz :: Double -> Double
bigEz Double
z = Double
1 forall a. Fractional a => a -> a -> a
/ ((Double
z forall a. Floating a => a -> a -> a
** Double
2 forall a. Num a => a -> a -> a
+ Double
4) forall a. Floating a => a -> a -> a
** (Double
3 forall a. Fractional a => a -> a -> a
/ Double
2))