From a7d7542dc646a5fd124ef71e71ce260889f1701b Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 2 Feb 2016 19:24:50 +0100 Subject: Moved to 1415 directory --- 1415/files/practicum/support.dcl | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 1415/files/practicum/support.dcl (limited to '1415/files/practicum/support.dcl') 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 -- cgit v1.2.3