ex2.2.hs 314 B

123456789101112131415
  1. -- Exercise 2.2
  2. -- George C. Privon
  3. -- 2023-09-05
  4. -- Define a constant
  5. e :: Double
  6. e = exp 1
  7. -- Define a function
  8. square :: Double -> Double
  9. square x = x ^ 2
  10. -- height of rock as a function of time, with a starting upward speed of 30 m/s
  11. yRock30 :: Double -> Double
  12. yRock30 t = 0.5 * (-9.8) * square t + 30 * t