소스 검색

commit entered code for chapter 4

George C. Privon 2 년 전
부모
커밋
1d12e1131c
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      04-motion/cv.hs

+ 12 - 0
04-motion/cv.hs

@@ -0,0 +1,12 @@
+type R = Double
+
+type Time           = R
+type TimeInterval   = R
+type Position       = R
+type Velocity       = R
+
+type PositionFunction = Time -> Position
+type VelocityFunction = Time -> Velocity
+
+positionCV :: Position -> Velocity -> Time -> Position
+positionCV x0 v0 t = v0 * t + x0