Sunday's Solutions ------------------- Exercise 1: plan: test determinant, then compute if necessary (define quad-roots (lambda (a b c) (if (< (- (* b b) (* 4 a c)) 0) (error "Complex roots!") (/ (+ (- b) (sqrt (- (* b b) (* 4 a c)))) (* 2 a))))) Exercise 2: plan: use Euclid's recursive algorithm (define gcd (lambda (a b) (if (= b 0) a (gcd b (remainder a b))))) Exercise 3: plan: write cube & proc to compute trig identity use to build recursive solution to sine (define cube (lambda (x) (* x x x))) (define p (lambda (sinx/3) (- (* 3 sinx/3) (* 4 (cube sinx/3))))) (define sine (lambda (angle) (if (< (abs angle) 0.1) angle (p (sine (/ angle 3))))))