guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Guile code for L-system


From: Giancarlo Bassi
Subject: Guile code for L-system
Date: Wed, 24 May 2006 15:02:43 +0200 (CEST)

I want to write in Guile the code implementing these following rewriting rules, which are taken from L-system rewriting (from Lindenmayer's
"Algorithmic beauty of plants")

Axiom a
a -> b
b -> ab

So, it should be create these lists

`(a) `(b) `(a b) `(b a b) `(a b b a b)  `(b a b a b b a b)

You may notice that the lists' length are Fibonacci's number.

This drill should introduce my final purpose to write the
Guile code for the Hilbert-Peano's curve, which in L-system
looks as:

Axiom x
x -> - f y + x f x + f y -
y -> + x f - y f y - f x +

where f means a translation and + - are rotations.


Then I'll be able to write the drgeo script for actually drawing that
curve, which looks as limit for the number of iterations to infinity.

Thanks a lot.
                GB

---
"I'm no Pawn, I'm Donald Duck ! "
       -- Donald in MathMagic Land






reply via email to

[Prev in Thread] Current Thread [Next in Thread]