diff options
author | Camil Staps | 2016-02-02 19:24:50 +0100 |
---|---|---|
committer | Camil Staps | 2016-02-02 19:24:50 +0100 |
commit | a7d7542dc646a5fd124ef71e71ce260889f1701b (patch) | |
tree | 04ed89503bbb3cc9933273a1326a53ca724c3492 /1415/files/practicum/support.dcl | |
parent | week6 camil: working positioning of lines by putting empties at left and righ... (diff) |
Diffstat (limited to '1415/files/practicum/support.dcl')
-rw-r--r-- | 1415/files/practicum/support.dcl | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/1415/files/practicum/support.dcl b/1415/files/practicum/support.dcl new file mode 100644 index 0000000..c96ece6 --- /dev/null +++ b/1415/files/practicum/support.dcl @@ -0,0 +1,36 @@ +definition module support
+
+import StdEnv, StdIO
+
+:: Pos // A position
+ = { rx :: !Real // 0.0 <= rx <= 1.0
+ , ry :: !Real // 0.0 <= ry <= 1.0
+ }
+:: Vel // A velocity
+ = { v0 :: !Real // -1.0 <= v0 <= 1.0
+ , v1 :: !Real // -1.0 <= v1 <= 1.0
+ }
+
+toPoint2 :: Size Pos -> Point2
+fromPoint2 :: Size Point2 -> Pos
+
+circle :: Int -> Oval
+
+movePos :: Vel Pos -> Pos
+
+instance zero Pos
+instance zero Vel
+instance + Pos
+instance - Pos
+instance + Vel
+instance - Vel
+
+class scale a :: !Real !a -> a
+class toVel a :: !a -> Vel
+class dist a :: !a !a -> Real
+
+instance scale Pos
+instance scale Vel
+instance toVel Pos
+instance dist Pos
+instance dist Real
|