Teaching Aid

 
Koch curve / modules
 

Koch curve / modules

 

 
Copy/Paste the following code to your GroIMP project:
//**********************************************************
/*
You will learn with this example:
– how to define your own modules in order to simplify the code
*/

// Koch curve with module definitions for rotation operators

module Rplus extends RU(60); // rotation counterclockwise
module Rminus extends RU(-60); // rotation clockwise

protected void init()
[
Axiom ==> F(10) RU(120) F(10) RU(120) F(10);
]

public void derivation()
[
// usage of the modules Rplus and Rminus for the rotation
F(x) ==> F(x/3) Rminus F(x/3) Rplus Rplus F(x/3) Rminus F(x/3);
]

//**********************************************************
 

DATE: 2009

 

AUTHOR: W. Kurth

 

DESCRIPTION: see model

 

Welcome to the website grogra.de. This site is the web centre of growth grammars of the Department Ecoinformatics, Biometrics and Forest Growth at the Georg-August University of Göttingen and its cooperation partners.

--- not found