visual-modeling/fig_13.1.svg

152 lines
8.2 KiB
XML
Raw Permalink Normal View History

2024-12-02 18:25:59 +00:00
<?xml version="1.0" standalone="no"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" style="background-color:rgb(0 0 0); background-opacity: 1" viewBox="-119.24648757929961 -119.24648757929921 230.79965337928923 230.79965337928923">
<g transform="scale(-1, 1) rotate(180)">
<line x1="70.71067811865476" y1="70.71067811865474" x2="70.71067811865477" y2="-70.71067811865426" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="70.71067811865477" y1="-70.71067811865426" x2="-70.71067811865423" y2="-70.71067811865427" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-70.71067811865423" y1="-70.71067811865427" x2="-70.71067811865426" y2="70.71067811865473" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-70.71067811865426" y1="70.71067811865473" x2="70.71067811865474" y2="70.71067811865473" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="73.53910524340093" y1="73.53910524340091" x2="73.53910524340094" y2="-73.53910524340108" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="73.53910524340094" y1="-73.53910524340108" x2="-73.53910524340105" y2="-73.5391052434011" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-73.53910524340105" y1="-73.5391052434011" x2="-73.53910524340108" y2="73.5391052434009" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-73.53910524340108" y1="73.5391052434009" x2="73.53910524340091" y2="73.5391052434009" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="76.3675323681471" y1="76.3675323681471" x2="76.36753236814711" y2="-76.3675323681469" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="76.36753236814711" y1="-76.3675323681469" x2="-76.36753236814688" y2="-76.36753236814691" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-76.36753236814688" y1="-76.36753236814691" x2="-76.36753236814691" y2="76.36753236814708" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-76.36753236814691" y1="76.36753236814708" x2="76.36753236814708" y2="76.36753236814708" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="79.19595949289328" y1="79.19595949289327" x2="79.1959594928933" y2="-79.19595949289372" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="79.1959594928933" y1="-79.19595949289372" x2="-79.19595949289369" y2="-79.19595949289373" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-79.19595949289369" y1="-79.19595949289373" x2="-79.19595949289372" y2="79.19595949289325" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-79.19595949289372" y1="79.19595949289325" x2="79.19595949289327" y2="79.19595949289325" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="82.02438661763945" y1="82.02438661763945" x2="82.02438661763946" y2="-82.02438661763954" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="82.02438661763946" y1="-82.02438661763954" x2="-82.02438661763952" y2="-82.02438661763955" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-82.02438661763952" y1="-82.02438661763955" x2="-82.02438661763955" y2="82.02438661763944" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-82.02438661763955" y1="82.02438661763944" x2="82.02438661763944" y2="82.02438661763944" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="84.85281374238562" y1="84.85281374238562" x2="84.85281374238564" y2="-84.85281374238537" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="84.85281374238564" y1="-84.85281374238537" x2="-84.85281374238535" y2="-84.85281374238538" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-84.85281374238535" y1="-84.85281374238538" x2="-84.85281374238538" y2="84.8528137423856" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-84.85281374238538" y1="84.8528137423856" x2="84.8528137423856" y2="84.8528137423856" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="87.6812408671318" y1="87.6812408671318" x2="87.68124086713182" y2="-87.6812408671322" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="87.68124086713182" y1="-87.6812408671322" x2="-87.68124086713219" y2="-87.68124086713223" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-87.68124086713219" y1="-87.68124086713223" x2="-87.68124086713222" y2="87.68124086713178" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-87.68124086713222" y1="87.68124086713178" x2="87.68124086713179" y2="87.68124086713178" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="90.50966799187798" y1="90.50966799187796" x2="90.50966799187799" y2="-90.50966799187805" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="90.50966799187799" y1="-90.50966799187805" x2="-90.50966799187802" y2="-90.50966799187808" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-90.50966799187802" y1="-90.50966799187808" x2="-90.50966799187805" y2="90.50966799187793" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-90.50966799187805" y1="90.50966799187793" x2="90.50966799187796" y2="90.50966799187793" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="93.33809511662415" y1="93.33809511662412" x2="93.33809511662416" y2="-93.33809511662488" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="93.33809511662416" y1="-93.33809511662488" x2="-93.33809511662484" y2="-93.33809511662491" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-93.33809511662484" y1="-93.33809511662491" x2="-93.33809511662487" y2="93.33809511662409" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-93.33809511662487" y1="93.33809511662409" x2="93.33809511662413" y2="93.33809511662409" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="96.16652224137033" y1="96.16652224137029" x2="96.16652224137034" y2="-96.16652224137071" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="96.16652224137034" y1="-96.16652224137071" x2="-96.16652224137066" y2="-96.16652224137074" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-96.16652224137066" y1="-96.16652224137074" x2="-96.16652224137069" y2="96.16652224137026" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-96.16652224137069" y1="96.16652224137026" x2="96.16652224137032" y2="96.16652224137026" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
</g>
<ludus>
fn ngon! (n, edge) -&gt; {
repeat n {
forward! (edge)
right! (inv (n))
}
}
fn cngon! (n, radius) -&gt; {
let angle = add (inv (4), inv (mult (2, n)))
let edge = mult (2, radius, sin (inv (mult (2, n))))
penup! ()
forward! (radius)
right! (angle)
pendown! ()
ngon! (n, edge)
left! (angle)
penup! ()
back! (radius)
pendown! ()
}
fn twisty_nonagons! (times, iter, radius, growth) -&gt; {
if gte? (iter, times) then :ok
else {
cngon! (9, radius)
right! (inv (times))
twisty_nonagons! (times, inc (iter), add (radius, growth), growth)
}
}
&amp; twisty_nonagons! (10, 0, 100, 3)
fn centre_squares! (times, radius, growth) -&gt; {
if lt? (times, 1) then :ok
else {
cngon! (4, radius)
centre_squares! (dec (times), add (radius, growth), growth)
}
}
right! (0.125)
centre_squares! (10, 100, 4)
fn twisty_triangles! (times, radius, angle, growth) -&gt; {
if lt? (times, 1) then :ok
else {
cngon! (3, radius)
right! (angle)
twisty_triangles! (dec (times), sub (radius, growth), angle, growth)
}
}
&amp; right! (inv (6))
&amp; twisty_triangles! (8, 100, inv (120), 10)
hideturtle! ()
</ludus>
</svg>