From 51836715aef17aa5a62da135a3475b9ae420231e Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan Date: Mon, 20 Sep 2010 22:20:56 +0530 Subject: [PATCH] solution to 2.75 --- src/sicp/ex2_75.rkt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/sicp/ex2_75.rkt diff --git a/src/sicp/ex2_75.rkt b/src/sicp/ex2_75.rkt new file mode 100644 index 0000000..0af9920 --- /dev/null +++ b/src/sicp/ex2_75.rkt @@ -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 -- 2.37.2