left fridge

This commit is contained in:
nik gaffney 2006-11-15 19:29:20 +01:00
parent 92422369dc
commit 97026b64e5
2 changed files with 15 additions and 9 deletions

View file

@ -205,23 +205,29 @@
;; distribute parents of given node evenly along a containment circle
;; centered on the node.
(dotimes (i n)
(let ((parent (list-ref parents i))
(x1 (* r (cos (* (* (+ t1 (- t2 t1)) (/ i n))))))
(y1 (* r (sin (* (* (+ t1 (- t2 t1)) (/ i n)))))))
(dotimes (k n)
(let ((parent (list-ref parents k))
(x1 (* r (cos (* (+ t1 (- t2 t1)) (/ k n)))))
(y1 (* r (sin (* (+ t1 (- t2 t1)) (/ k n))))))
(send pb move-to parent
(+ xi x1) (+ yi y1))
;; draw circles around the nodes parents and evenly distribute their
;; parents along containment arcs.
(debug 1 "----~a~% x1:~a~% y1:~a~% t1':~a~% t2':~a~%"
parent
x1 y1
(- (/ pi 2) (atan (/ (- yi y1) (- xi x1))))
(+ (/ pi 2) (atan (/ (- yi y1) (- xi x1)))))
(shadowpi-tree parent pb
(+ xi x1) (+ yi y1) ;; centred on
(atan (/ (- y1 yi) (- x1 xi)))
(+ pi (atan (/ (- y1 yi) (- x1 xi))))
(- (atan (/ (- yi y1) (- xi x1))) (/ pi 2))
(+ (/ pi 2) (atan (/ (- yi y1) (- xi x1))))
(* r phi)) ;; radius
(* r phi)) ;; radius
;; this proceeds recursively, so that successively distant descendants of
;; the goven node are positioned on successively smaller containment arcs.

View file

@ -118,7 +118,7 @@
[(#\z) ;; C-z re.colour
(colour-tree selected-snip p)]
[(#\x) ;; C-x re.lapse
(shadowpi-tree selected-snip p 0 0 0 (* 2 pi) 120)]
(shadowpi-tree selected-snip p 10 10 0 (* 2 pi) 120)]
[(#\=) ;; C-= zoom->out
(send p zoom 1.1)]
[(#\-) ;; C-- zoom->in