Fractal Polygons: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
In the last line of the input window there is the command | In the last line of the input window there is the command | ||
<source lang="javascript"> | <source lang="javascript"> | ||
fracPolygone(5,100,0.4,5 | fracPolygone(5,100,0.4,5); | ||
</source> | </source> | ||
The meaning of the parameters is | The meaning of the parameters is | ||
Line 18: | Line 18: | ||
function fracPolygone(corner,len,shrink,recurs) { | function fracPolygone(corner,len,shrink,recurs) { | ||
if (recurs>0) { | if (recurs>0) { | ||
if ( | if (arguments.length==4) { // initial call | ||
t.rt(180); | t.rt(180); | ||
fracPolygone(corner,len*shrink,shrink,recurs-1,1); | fracPolygone(corner,len*shrink,shrink,recurs-1,1); |
Revision as of 11:17, 21 December 2008
In the last line of the input window there is the command
fracPolygone(5,100,0.4,5);
The meaning of the parameters is
- 5: number of vertices of the regular polygone,
- 100: length of a side of the initial poylgone,
- 0.4: shrink factor from one level to the next,
- 5: number of recursion steps
- 1
References
- Peter Baptist, Wolfgang Neidhardt, Alfred Wassermann: Symmetry and Regular Polygons, Prispevki k poucevanju Matematike, The Improvement of Mathematics Education in Secondary Schools: A Tempus Project, Maribor 1996