|
|
@@ -0,0 +1,19 @@
|
|
|
+-- Exercise 2.3
|
|
|
+-- George C. Privon
|
|
|
+-- 2023-09-05
|
|
|
+
|
|
|
+-- Define a constant
|
|
|
+e :: Double
|
|
|
+e = exp 1
|
|
|
+
|
|
|
+-- Define a function
|
|
|
+square :: Double -> Double
|
|
|
+square x = x ^ 2
|
|
|
+
|
|
|
+-- height of rock as a function of time, with a starting upward speed of 30 m/s
|
|
|
+yRock30 :: Double -> Double
|
|
|
+yRock30 t = 0.5 * (-9.8) * square t + 30 * t
|
|
|
+
|
|
|
+-- velocity of rock as a function of time
|
|
|
+vRock30 :: Double -> Double
|
|
|
+vRock30 t = (-9.8) * t + 30
|