Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun conversion (dim)
- (let* ((m (/ (fourth dim) (first (fifth dim)) (third dim)))
- (x1 (* m (- (* (fourth dim) (first dim)) (first (fifth dim)))))
- (y1 (* m (- (/ (first (fifth dim)) (third dim)) (* 2 (second dim))))))
- (list x1 y1)))
- (defun fn (coords)
- (list (- (expt (first coords) 2)
- (+ (expt (second coords) 2) (third coords)))
- (+ (* 2 (first coords) (second coords)
- (third coords)))))
- (defun draw (coords)
- (print coords))
- (defun abslt (coords)
- (+ (expt (first coords) 2)
- (expt (second coords) 2)))
- (defun julia ()
- (let* ((R 1.0) ;; radius
- (mult 1.0) ;; multiplier
- (i 0)
- (iterations 100)
- (x (* mult (random 1.0)))
- (y (* mult (random 1.0)))
- (dim (list 100 100 100))
- (z (conversion (list x y mult R dim))))
- (loop while (and (< i iterations) (abslt z)
- (fn (list (first z) (second z) (third dim)))
- (if (> (abslt z) R)
- (return))
- (incf i)))
- (if (> i -1)
- (draw (list x y (/ i iterations))))
- (julia)))
- (julia)
Add Comment
Please, Sign In to add comment