visual-modeling/fig_13.3.svg

119 lines
5.6 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="-107.38715006927109 -70.78460969082693 207.8460969082661 180.0000000000004">
<g transform="scale(-1, 1) rotate(180)">
<line x1="86.60254037844398" y1="49.99999999999982" x2="-6.679101716144942e-13" y2="-100.00000000000003" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-6.679101716144942e-13" y1="-100.00000000000003" x2="-86.60254037844447" y2="50.00000000000031" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-86.60254037844447" y1="50.00000000000031" x2="86.60254037844354" y2="50.00000000000031" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="80.19058717695282" y1="40.85914497655947" x2="-4.7102360618649755" y2="-89.87665812791161" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-4.7102360618649755" y1="-89.87665812791161" x2="-75.48035111508872" y2="49.01751315135226" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-75.48035111508872" y1="49.01751315135226" x2="80.19058717695262" y2="40.85914497655993" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="73.08363661140767" y1="32.53893144606465" x2="-8.36227706141166" y2="-79.56175162946172" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-8.36227706141166" y1="-79.56175162946172" x2="-64.72135954999632" y2="47.022820183397286" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-64.72135954999632" y1="47.022820183397286" x2="73.08363661140751" y2="32.538931446065064" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="65.35062985480369" y1="25.085756468171926" x2="-10.950412552815067" y2="-69.13818384165947" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-10.950412552815067" y1="-69.13818384165947" x2="-54.400217301988484" y2="44.052427373487745" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-54.400217301988484" y1="44.052427373487745" x2="65.35062985480357" y2="25.08575646817261" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="57.063390977708856" y1="18.541019662498126" x2="-12.474701449064646" y2="-58.68885604402868" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-12.474701449064646" y1="-58.68885604402868" x2="-44.58868952864498" y2="40.14783638153081" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-44.58868952864498" y1="40.14783638153081" x2="57.06339097770875" y2="18.541019662498435" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="48.29629131445312" y1="12.940952255127293" x2="-12.940952255124998" y2="-48.296291314453555" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-12.940952255124998" y1="-48.296291314453555" x2="-35.355339059328415" y2="35.355339059326724" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-35.355339059328415" y1="35.355339059326724" x2="48.296291314453" y2="12.940952255127556" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="39.12590402935198" y1="8.316467632711499" x2="-12.360679774996967" y2="-38.04226065180634" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-12.360679774996967" y1="-38.04226065180634" x2="-26.76522425435524" y2="29.7257930190952" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-26.76522425435524" y1="29.7257930190952" x2="39.125904029351936" y2="8.316467632711714" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="29.630650217853976" y1="4.693033951207862" x2="-10.751038486358219" y2="-28.007412794916245" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-10.751038486358219" y1="-28.007412794916245" x2="-18.879611731495892" y2="23.31437884370867" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
<line x1="-18.879611731495892" y1="23.31437884370867" x2="29.63065021785394" y2="4.693033951208033" 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)
}
}
&amp; right! (0.125)
&amp; 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)
}
}
right! (inv (6))
twisty_triangles! (8, 100, inv (120), 10)
hideturtle! ()
</ludus>
</svg>