solution to 2.75
authorRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Mon, 20 Sep 2010 16:50:56 +0000 (22:20 +0530)
committerRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Mon, 20 Sep 2010 16:50:56 +0000 (22:20 +0530)
src/sicp/ex2_75.rkt [new file with mode: 0644]

diff --git a/src/sicp/ex2_75.rkt b/src/sicp/ex2_75.rkt
new file mode 100644 (file)
index 0000000..0af9920
--- /dev/null
@@ -0,0 +1,12 @@
+#lang racket
+
+(define (make-from-mag-ang r a)
+  (define (dispatch op)
+    (cond
+      [(eq? op 'magnitude) r]
+      [(eq? op 'angle) a]
+      [(eq? op 'real-part) (* r (cos a))]
+      [(eq? op 'imag-part) (* r (sin a))]))
+  dispatch)
+
+      
\ No newline at end of file