add fig 13
This commit is contained in:
parent
be8fd0eeb0
commit
57be0a2f88
|
@ -876,8 +876,10 @@ Here is the finished `cngon!`:
|
|||
|
||||
```
|
||||
fn cngon! (n, radius) -> {
|
||||
let angle = sub (inv (2), inv (n))
|
||||
let angle = add (inv (4), inv (mult (2, n)))
|
||||
& ^... this is equation (5), above, solving for `d`
|
||||
let edge = mult (2, radius, sin (inv (mult (2, n))))
|
||||
& ^... this is equation (8), above, solving for `e`
|
||||
|
||||
penup! ()
|
||||
forward! (radius)
|
||||
|
@ -918,7 +920,13 @@ Combine the ideas of `spingon!` with your newly constructed `cngon!`.
|
|||
Design a fancier `cngon!` that fills up a polygon with textures.
|
||||
Here are a few visual tips for Exercises 1.3 and 1.4:
|
||||
|
||||
{{Figure 13: `spincngon`s. Bottom of p. 32.}}
|
||||
<img src="fig_13.1.svg" alt="Nested squares." width="400" />
|
||||
|
||||
<img src="fig_13.2.svg" alt="Twisty, nested nonagons." width="400" />
|
||||
|
||||
<img src="fig_13.3.svg" alt="Twisty, nested triangles." width="400" />
|
||||
|
||||
##### Figure 13: `spincngon`s.
|
||||
|
||||
#### Exercise 1.5
|
||||
Design a Ludus function that puts polygons on the vertices of other polygons.
|
||||
|
|
151
fig_13.1.svg
Normal file
151
fig_13.1.svg
Normal file
|
@ -0,0 +1,151 @@
|
|||
<?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) -> {
|
||||
repeat n {
|
||||
forward! (edge)
|
||||
right! (inv (n))
|
||||
}
|
||||
}
|
||||
|
||||
fn cngon! (n, radius) -> {
|
||||
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) -> {
|
||||
if gte? (iter, times) then :ok
|
||||
else {
|
||||
cngon! (9, radius)
|
||||
right! (inv (times))
|
||||
twisty_nonagons! (times, inc (iter), add (radius, growth), growth)
|
||||
}
|
||||
}
|
||||
|
||||
& twisty_nonagons! (10, 0, 100, 3)
|
||||
|
||||
fn centre_squares! (times, radius, growth) -> {
|
||||
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) -> {
|
||||
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>
|
||||
|
After Width: | Height: | Size: 8.2 KiB |
251
fig_13.2.svg
Normal file
251
fig_13.2.svg
Normal file
|
@ -0,0 +1,251 @@
|
|||
<?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="-153.17137779091564 -156.6344549368567 299.43820553859143 298.5250437205932">
|
||||
|
||||
<g transform="scale(-1, 1) rotate(180)">
|
||||
|
||||
<line x1="6.123233995736766e-15" y1="100" x2="64.27876096865381" y2="76.60444431189764" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="64.27876096865381" y1="76.60444431189764" x2="98.48077530122053" y2="17.364817766692845" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="98.48077530122053" y1="17.364817766692845" x2="86.60254037844349" y2="-50.00000000000012" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="86.60254037844349" y1="-50.00000000000012" x2="34.20201433256649" y2="-93.96926207859087" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="34.20201433256649" y1="-93.96926207859087" x2="-34.2020143325672" y2="-93.96926207859089" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-34.2020143325672" y1="-93.96926207859089" x2="-86.60254037844422" y2="-50.000000000000156" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-86.60254037844422" y1="-50.000000000000156" x2="-98.48077530122133" y2="17.364817766692795" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-98.48077530122133" y1="17.364817766692795" x2="-64.2787609686547" y2="76.60444431189764" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-64.2787609686547" y1="76.60444431189764" x2="-9.094947017729282e-13" y2="100.00000000000009" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="60.54188098612396" y1="83.32875042062017" x2="99.94045980642717" y2="24.917955246766518" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="99.94045980642717" y1="24.917955246766518" x2="92.57578676881414" y2="-45.152228119274305" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="92.57578676881414" y1="-45.152228119274305" x2="41.893874236807676" y2="-94.0951821371876" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="41.893874236807676" y1="-94.0951821371876" x2="-28.39064764915065" y2="-99.00995468164713" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-28.39064764915065" y1="-99.00995468164713" x2="-85.39086997316946" y2="-57.59686905748773" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-85.39086997316946" y1="-57.59686905748773" x2="-102.43575522293307" y2="10.76643171656736" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-102.43575522293307" y1="10.76643171656736" x2="-71.54981215727824" y2="74.09199943488045" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-71.54981215727824" y1="74.09199943488045" x2="-7.1849167956466715" y2="102.74909717676192" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-7.1849167956466715" y1="102.74909717676192" x2="60.54188098612319" y2="83.32875042062024" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="100.81199072728545" y1="32.75580140374555" x2="98.28148858407945" y2="-39.7082989020856" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="98.28148858407945" y1="-39.7082989020856" x2="49.76398565530499" y2="-93.59244484304574" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="49.76398565530499" y1="-93.59244484304574" x2="-22.038639226681838" y2="-103.68364567778367" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-22.038639226681838" y1="-103.68364567778367" x2="-83.52913988231231" y2="-65.26011638452067" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-83.52913988231231" y1="-65.26011638452067" x2="-105.93542766402462" y2="3.6993466504640082" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-105.93542766402462" y1="3.6993466504640082" x2="-78.77335150060492" y2="70.92784427403816" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-78.77335150060492" y1="70.92784427403816" x2="-14.752348701768383" y2="104.96841528660629" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-14.752348701768383" y1="104.96841528660629" x2="56.171442008718444" y2="89.89309819258163" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="56.171442008718444" y1="89.89309819258163" x2="100.81199072728552" y2="32.75580140374529" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="103.66516027617162" y1="-33.68285238686843" x2="57.76119980141968" y2="-92.43724248104998" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="57.76119980141968" y1="-92.43724248104998" x2="-15.169868004646688" y2="-107.9392194928313" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-15.169868004646688" y1="-107.9392194928313" x2="-81.0027859770358" y2="-72.93523609311616" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-81.0027859770358" y1="-72.93523609311616" x2="-108.93360014508178" y2="-3.8040451405734075" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-108.93360014508178" y1="-3.8040451405734075" x2="-85.89317214313355" y2="67.10710081049614" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-85.89317214313355" y1="67.10710081049614" x2="-22.66237429913697" y2="106.61808847998478" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-22.66237429913697" y1="106.61808847998478" x2="51.172400343661025" y2="96.24128762162385" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="51.172400343661025" y1="96.24128762162385" x2="101.06304014777956" y2="40.832118682335924" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="101.06304014777956" y1="40.832118682335924" x2="103.66516027617273" y2="-33.68285238686773" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="65.83194825675952" y1="-90.6099033699933" x2="-7.8127250593390585" y2="-111.72717362910109" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-7.8127250593390585" y1="-111.72717362910109" x2="-77.80173749140548" y2="-80.56605763793138" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-77.80173749140548" y1="-80.56605763793138" x2="-111.38645228124619" y2="-11.707187885980517" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-111.38645228124619" y1="-11.707187885980517" x2="-92.85220812616637" y2="62.62960518872086" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-92.85220812616637" y1="62.62960518872086" x2="-30.87138385150702" y2="107.66130994509086" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-30.87138385150702" y1="107.66130994509086" x2="45.554504024486704" y2="102.31709125597303" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="45.554504024486704" y1="102.31709125597303" x2="100.6649331855057" y2="49.09756844038039" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="100.6649331855057" y1="49.09756844038039" x2="108.67312134291356" y2="-27.095252307158752" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="108.67312134291356" y1="-27.095252307158752" x2="65.83194825676158" y2="-90.60990336999186" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="6.019565531255095e-12" y1="-115.0000000000009" x2="-73.92057511394722" y2="-88.09511095868676" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-73.92057511394722" y1="-88.09511095868676" x2="-113.25289159640243" y2="-19.969540431703194" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-113.25289159640243" y1="-19.969540431703194" x2="-99.5929214352129" y2="57.499999999994486" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-99.5929214352129" y1="57.499999999994486" x2="-39.332316482457074" y2="108.06465139037718" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-39.332316482457074" y1="108.06465139037718" x2="39.33231648244673" y2="108.0646513903816" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="39.33231648244673" y1="108.0646513903816" x2="99.59292143520821" y2="57.500000000005656" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="99.59292143520821" y1="57.500000000005656" x2="113.25289159640641" y2="-19.96954043169049" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="113.25289159640641" y1="-19.96954043169049" x2="73.92057511395882" y2="-88.09511095867846" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="73.92057511395882" y1="-88.09511095867846" x2="8.569145393266808e-12" y2="-115.00000000000085" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-69.35865977050449" y1="-95.46400533624983" x2="-114.49489570056497" y2="-28.546783680770034" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-114.49489570056497" y1="-28.546783680770034" x2="-106.05769746330498" y2="51.72779532110249" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-106.05769746330498" y1="51.72779532110249" x2="-47.99492388295196" y2="107.79836400182265" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-47.99492388295196" y1="107.79836400182265" x2="32.52520798639791" y2="113.42888012072369" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="32.52520798639791" y1="113.42888012072369" x2="97.82643356149072" y2="65.98476260955545" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="97.82643356149072" y1="65.98476260955545" x2="117.35358365345854" y2="-12.334358665574157" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="117.35358365345854" y1="-12.334358665574157" x2="81.96968771417019" y2="-84.88209643995489" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="81.96968771417019" y1="-84.88209643995489" x2="8.231263901818195" y2="-117.71255793065978" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="8.231263901818195" y1="-117.71255793065978" x2="-69.35865977050241" y2="-95.46400533625133" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-115.07783847170973" y1="-37.39105631938088" x2="-112.18924640258533" y2="45.32739780331336" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-112.18924640258533" y1="45.32739780331336" x2="-56.80605909710284" y2="106.83665873592352" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-56.80605909710284" y1="106.83665873592352" x2="25.157314588937645" y2="118.35585968879202" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="25.157314588937645" y1="118.35585968879202" x2="95.34930118640659" y2="74.4950385144134" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="95.34930118640659" y1="74.4950385144134" x2="120.92629006931206" y2="-4.222839100991166" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="120.92629006931206" y1="-4.222839100991166" x2="89.92052388277443" y2="-80.9648033694137" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="89.92052388277443" y1="-80.9648033694137" x2="16.839945216181945" y2="-119.8224363177299" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="16.839945216181945" y1="-119.8224363177299" x2="-64.12023097220568" y2="-102.61381963493656" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-64.12023097220568" y1="-102.61381963493656" x2="-115.07783847170896" y2="-37.39105631938355" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-117.9310080206033" y1="38.31810730247797" x2="-65.7099887649297" y2="105.15796392338751" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-65.7099887649297" y1="105.15796392338751" x2="17.25746451903362" y2="122.79324052395555" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="17.25746451903362" y1="122.79324052395555" x2="92.1499583591873" y2="82.97219518850859" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="92.1499583591873" y1="82.97219518850859" x2="123.92446255036825" y2="4.3275375911243685" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="123.92446255036825" y1="4.3275375911243685" x2="97.71333344724437" y2="-76.34202294037073" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="97.71333344724437" y1="-76.34202294037073" x2="25.781049661418976" y2="-121.29030249099046" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="25.781049661418976" y1="-121.29030249099046" x2="-58.214473785435175" y2="-109.4855015145168" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-58.214473785435175" y1="-109.4855015145168" x2="-114.97079796627496" y2="-46.45121758359077" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-114.97079796627496" y1="-46.45121758359077" x2="-117.93100802060417" y2="38.31810730247535" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-74.64872704115851" y1="102.74515828560612" x2="8.859072165486069" y2="126.69063438299756" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="8.859072165486069" y1="126.69063438299756" x2="88.22161304828002" y2="91.35615464302019" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="88.22161304828002" y1="91.35615464302019" x2="126.30428071176974" y2="13.275114835009134" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="126.30428071176974" y1="13.275114835009134" x2="105.28777171450209" y2="-71.01749874077092" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="105.28777171450209" y1="-71.01749874077092" x2="35.00594418877853" y2="-122.08023538416343" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="35.00594418877853" y1="-122.08023538416343" x2="-51.655553670607986" y2="-116.02027312062083" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-51.655553670607986" y1="-116.02027312062083" x2="-114.14684387998518" y2="-55.673135642233255" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-114.14684387998518" y1="-55.673135642233255" x2="-123.22755723705649" y2="30.724080741135943" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
<line x1="-123.22755723705649" y1="30.724080741135943" x2="-74.64872704116081" y2="102.74515828560448" stroke="rgb(255 255 255)" stroke-opacity="1" stroke-width="1"/>
|
||||
|
||||
|
||||
</g>
|
||||
|
||||
<ludus>
|
||||
|
||||
fn ngon! (n, edge) -> {
|
||||
repeat n {
|
||||
forward! (edge)
|
||||
right! (inv (n))
|
||||
}
|
||||
}
|
||||
|
||||
fn cngon! (n, radius) -> {
|
||||
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) -> {
|
||||
if gte? (iter, times) then :ok
|
||||
else {
|
||||
cngon! (9, radius)
|
||||
right! (inv (times))
|
||||
twisty_nonagons! (times, inc (iter), add (radius, growth), growth)
|
||||
}
|
||||
}
|
||||
|
||||
twisty_nonagons! (10, 0, 100, 3)
|
||||
|
||||
fn centre_squares! (times, radius, growth) -> {
|
||||
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) -> {
|
||||
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>
|
||||
|
After Width: | Height: | Size: 17 KiB |
118
fig_13.3.svg
Normal file
118
fig_13.3.svg
Normal file
|
@ -0,0 +1,118 @@
|
|||
<?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) -> {
|
||||
repeat n {
|
||||
forward! (edge)
|
||||
right! (inv (n))
|
||||
}
|
||||
}
|
||||
|
||||
fn cngon! (n, radius) -> {
|
||||
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) -> {
|
||||
if gte? (iter, times) then :ok
|
||||
else {
|
||||
cngon! (9, radius)
|
||||
right! (inv (times))
|
||||
twisty_nonagons! (times, inc (iter), add (radius, growth), growth)
|
||||
}
|
||||
}
|
||||
|
||||
& twisty_nonagons! (10, 0, 100, 3)
|
||||
|
||||
fn centre_squares! (times, radius, growth) -> {
|
||||
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) -> {
|
||||
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>
|
||||
|
After Width: | Height: | Size: 5.6 KiB |
Loading…
Reference in New Issue
Block a user