<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://dokuwiki.grogra.de/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://dokuwiki.grogra.de/feed.php">
        <title>GroIMP wiki - 02_user_tutorials:21_exercices</title>
        <description></description>
        <link>https://dokuwiki.grogra.de/</link>
        <image rdf:resource="https://dokuwiki.grogra.de/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-05-16T08:17:54+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://dokuwiki.grogra.de/doku.php?id=02_user_tutorials:21_exercices:01_exercises_plant_like_structures_abop&amp;rev=1765380011&amp;do=diff"/>
                <rdf:li rdf:resource="https://dokuwiki.grogra.de/doku.php?id=02_user_tutorials:21_exercices:02_exercises_binary_tree_3d2d&amp;rev=1765380089&amp;do=diff"/>
                <rdf:li rdf:resource="https://dokuwiki.grogra.de/doku.php?id=02_user_tutorials:21_exercices:03_exercises_binary_ternary_tree&amp;rev=1765380166&amp;do=diff"/>
                <rdf:li rdf:resource="https://dokuwiki.grogra.de/doku.php?id=02_user_tutorials:21_exercices:05_exercises_spirals&amp;rev=1765380248&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://dokuwiki.grogra.de/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>GroIMP wiki</title>
        <link>https://dokuwiki.grogra.de/</link>
        <url>https://dokuwiki.grogra.de/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="https://dokuwiki.grogra.de/doku.php?id=02_user_tutorials:21_exercices:01_exercises_plant_like_structures_abop&amp;rev=1765380011&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-10T15:20:11+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Implement &#039;plant like structures&#039;</title>
        <link>https://dokuwiki.grogra.de/doku.php?id=02_user_tutorials:21_exercices:01_exercises_plant_like_structures_abop&amp;rev=1765380011&amp;do=diff</link>
        <description>Implement &#039;plant like structures&#039;

Implement the &#039;plant like structures&#039; as described in the book “The Algorithmic Beauty of Plants” by Prusinkiewicz and Lindenmayer (1990) on page 25 in Figure 1.24.



Help

In order to have a X (model d), e), and f)) that we can use, we first need to define it as module. For this a module without any parameters, extends, or instantiations is doing the job just fine. While we already have a</description>
    </item>
    <item rdf:about="https://dokuwiki.grogra.de/doku.php?id=02_user_tutorials:21_exercices:02_exercises_binary_tree_3d2d&amp;rev=1765380089&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-10T15:21:29+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>From 3D binary tree to 2D binary tree</title>
        <link>https://dokuwiki.grogra.de/doku.php?id=02_user_tutorials:21_exercices:02_exercises_binary_tree_3d2d&amp;rev=1765380089&amp;do=diff</link>
        <description>From 3D binary tree to 2D binary tree

Change the default 3d binary tree to a 2d version, growing planar in one plane.



Solution

RU(90)


public void run1() [
  A(x) ==&gt; F(x)
    [RU( 30) A(x*0.8)]  // first branch
    [RU(-30) A(x*0.8)]; // second branch
]</description>
    </item>
    <item rdf:about="https://dokuwiki.grogra.de/doku.php?id=02_user_tutorials:21_exercices:03_exercises_binary_ternary_tree&amp;rev=1765380166&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-10T15:22:46+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>From binary to ternary tree</title>
        <link>https://dokuwiki.grogra.de/doku.php?id=02_user_tutorials:21_exercices:03_exercises_binary_ternary_tree&amp;rev=1765380166&amp;do=diff</link>
        <description>From binary to ternary tree

Change the default 3d binary tree to a ternary version, a tree with tree instead of two branches.



Solution




public void run3() [
  A(x) ==&gt; F(x) 
    [RH(  0) RU(45) RH(90) A(x*0.8)]  // first branch  
    [RH(120) RU(45) RH(90) A(x*0.8)]  // second branch
    [RH(240) RU(45) RH(90) A(x*0.8)]; // third branch
]</description>
    </item>
    <item rdf:about="https://dokuwiki.grogra.de/doku.php?id=02_user_tutorials:21_exercices:05_exercises_spirals&amp;rev=1765380248&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-10T15:24:08+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Generate some spirals</title>
        <link>https://dokuwiki.grogra.de/doku.php?id=02_user_tutorials:21_exercices:05_exercises_spirals&amp;rev=1765380248&amp;do=diff</link>
        <description>Generate some spirals

Write some code to generate simple spirals.



s1: a=50 degree, s=0.88

s2: a=80 degree, s=1.0

s3: a=120 degree, s=0.75

s4: a=145 degree, s=1.05

Play around with different angles and shrinking factors.

Solution

AA


module A(float len);

protected void init() [
  Axiom ==&gt; A(1);
]

public void run()[
  A(x) ==&gt; F(x,0.05) RL(50) A(x*0.88);
]</description>
    </item>
</rdf:RDF>
