我想知道是否有人对编写 mandelbrot 流有任何建议。我为自己编写了以下函数来提供帮助:
(define (make-complex a b) (cons a b))
(define (real-coeff c) (car c))
(define (imag-coeff c) (cdr c))
(define (c-add c d)
(make-complex (+ (real-coeff c) (real-coeff d))
(+ (imag-coeff c) (imag-coeff d))))
(define (c-mult c d)
(make-complex (- (* (real-coeff c) (real-coeff d))
(* (imag-coeff c) (imag-coeff d)))
(+ (* (real-coeff c) (imag-coeff d))
(* (imag-coeff c) (real-coeff d)))))
(define (c-length c)
(define (square x) (* x x))
(sqrt (+ (square (real-coeff c))
(square (imag-coeff c)))))
我有那个 fz(x) = x2 +z。流应返回:a、fz(a)、fz(fz(a))、fz(fz(fz(a)))。我对如何使用我编写的函数来创建具有此输出的流感到困惑。任何人都对去哪里有一些好的建议?