(defun abs (x) (cond ((>= x 0.0) x) (t (* -1.0 x))))

(defun zeichneBaum (x1 y1 x2 y2 &aux x3 y3 x4 y4 x5 y5)
  (cond ((or (> (abs (- x2 x1)) 2.0)
              (> (abs (- y2 y1)) 2.0))  ; noch groß genug
         (setq x3 (+ x2 (- y1 y2))) ; hier die beiden restlichen
         (setq y3 (+ y2 (- x2 x1))) ; Eckpunkte des Quadrats
         (setq x4 (+ x1 (- y1 y2))) ; berechnen
         (setq y4 (+ y1 (- x2 x1)))
         (setq x5 (+ x3 (* 0.12 (+ x3 (* 3.0 x4) (* -4.0 x2)))))
         (setq y5 (+ y3 (* 0.12 (+ y3 (* 3.0 y4) (* -4.0 y2)))))
         (polygon 1 x3 y3 x2 y2 x1 y1 x4 y4)
         (zeichneBaum x4 y4 x5 y5)
         (zeichneBaum x5 y5 x3 y3)
        )
   )
)

(graphic)
(clear)
(zeichneBaum 10.0 -80.0 60.0 -80.0)
