summaryrefslogtreecommitdiff
path: root/coding-exercises/2/78/complex-rectangular.rkt
diff options
context:
space:
mode:
Diffstat (limited to 'coding-exercises/2/78/complex-rectangular.rkt')
-rw-r--r--coding-exercises/2/78/complex-rectangular.rkt8
1 files changed, 4 insertions, 4 deletions
diff --git a/coding-exercises/2/78/complex-rectangular.rkt b/coding-exercises/2/78/complex-rectangular.rkt
index bbc2b8c..be4f0e5 100644
--- a/coding-exercises/2/78/complex-rectangular.rkt
+++ b/coding-exercises/2/78/complex-rectangular.rkt
@@ -3,14 +3,14 @@
(require "../../../shared/data-directed-programming.rkt")
-(define (install-rectangular-package put)
+(define (install-rectangular-package apply-generic put)
(define (real-part z) (car z))
(define (imag-part z) (cdr z))
(define (make-from-real-imag x y) (cons x y))
- (define (magnitude z) (sqrt (+ (sqr (real-part z))
- (sqr (real-part z)))))
+ (define (magnitude z) (apply-generic 'sqrt (+ (apply-generic 'sqr (real-part z))
+ (apply-generic 'sqr (real-part z)))))
(define (angle z)
- (atan (imag-part z)
+ (apply-generic 'atan (imag-part z)
(real-part z)))
(define (make-from-mag-ang r a)
(cons (* r (cos a))