make it to p. 51, text-setting only (but code works)

This commit is contained in:
Scott Richmond 2025-01-02 23:41:27 -05:00
parent c7320e3a0b
commit d7705fa988

View File

@ -66,7 +66,7 @@ We will need some short sections of plastic pipe, the kind used for plumbing.
Try to find as many different-diametered pipes as you can. Try to find as many different-diametered pipes as you can.
Here is a sketch of what you might have picked up so far. Here is a sketch of what you might have picked up so far.
FIGURE 1: Pipes ##### FIGURE 1: Pipes
Next, let's assemble a collection of wooden dowels of various diameters, from very small diameters to very large ones. Next, let's assemble a collection of wooden dowels of various diameters, from very small diameters to very large ones.
Dowels, or rounded wooden pegs, are used to join together adjacent parts by fitting tightly into two corresponding holes. Dowels, or rounded wooden pegs, are used to join together adjacent parts by fitting tightly into two corresponding holes.
@ -75,19 +75,19 @@ Call the dowels that you have assembled "rollers"; you will see why in just a mi
Here is a sketch of my dowel collection. Here is a sketch of my dowel collection.
(Sketches are models, too.) (Sketches are models, too.)
FIGURE 2: Dowels ##### FIGURE 2: Dowels
### Assembling the pipe-and-roller machine ### Assembling the pipe-and-roller machine
Now, imagine that one section of pipe is floating in the air at eye level; one end of the pipe is clearly visible to us, and the pipe's length is parallel to the ground. Now, imagine that one section of pipe is floating in the air at eye level; one end of the pipe is clearly visible to us, and the pipe's length is parallel to the ground.
Now, hold one of the dowel-rollers parallel to the length of the pipe and place it on top of the pipe. Now, hold one of the dowel-rollers parallel to the length of the pipe and place it on top of the pipe.
FIGURE 3: Dowel-on-pipe ##### FIGURE 3: Dowel-on-pipe
Next, imagine rolling the dowel around the circumference of the pipe until it arrives back at its starting position at the top of the pipe. Next, imagine rolling the dowel around the circumference of the pipe until it arrives back at its starting position at the top of the pipe.
You will have to hold the roller very carefully so that it doesn't slip on the pipe but rolls nicely in contact with the pipe. You will have to hold the roller very carefully so that it doesn't slip on the pipe but rolls nicely in contact with the pipe.
If you roll the dowel around the pipe in a counterclockwise direction, the dowel will also turn counterclockwise. If you roll the dowel around the pipe in a counterclockwise direction, the dowel will also turn counterclockwise.
FIGURES 4 & 5: Dowel rotations around the pipe ##### FIGURES 4 & 5: Dowel rotations around the pipe
The dowel would turn in a clockwise direction if the rolling-about-the-pipe was also in a clockwise direction. The dowel would turn in a clockwise direction if the rolling-about-the-pipe was also in a clockwise direction.
Note the two motions of the roller: the roller goes around the pipe as it turns around it own center. Note the two motions of the roller: the roller goes around the pipe as it turns around it own center.
@ -101,7 +101,7 @@ Or better still, can you create a Logo model of this roller/pipe machine that ca
Imagine, for example, that we glue an arrow onto the end of the roller. Imagine, for example, that we glue an arrow onto the end of the roller.
FIGURE 6: Arrow on roller ##### FIGURE 6: Arrow on roller
What pattern will the tip of this arrow trace out as the roller moves around the pipe? What pattern will the tip of this arrow trace out as the roller moves around the pipe?
Imagine a series of photographs taken at regular intervals as the roller moves around the pipe. Imagine a series of photographs taken at regular intervals as the roller moves around the pipe.
@ -124,7 +124,7 @@ The dark bands in the figure indicate the contact surfaces between the roller an
If there is no slipping, the length of the band on the roller must equal the length of the band of the pipe. If there is no slipping, the length of the band on the roller must equal the length of the band of the pipe.
Why? Why?
FIGURES 7 & 8: Rotation diagrams. ##### FIGURES 7 & 8: Rotation diagrams.
We could think of this rolling in another way. We could think of this rolling in another way.
See the figure on the right above. See the figure on the right above.
@ -139,7 +139,7 @@ Well, what do we know about circumferences?
Any circle's circumference, C, equals 2πR, where R is the radius of the circle. Any circle's circumference, C, equals 2πR, where R is the radius of the circle.
Now look at the figure on the next page. Now look at the figure on the next page.
FIGURE 9: Rotation diagram with labelled angles. ##### FIGURE 9: Rotation diagram with labelled angles.
The band on the pipe is some fraction of the circumference of the pipe. The band on the pipe is some fraction of the circumference of the pipe.
This fraction is the angle θ (theta), measured in degrees, divided by 360, the total number of degrees in a circle. This fraction is the angle θ (theta), measured in degrees, divided by 360, the total number of degrees in a circle.
@ -152,294 +152,337 @@ We can set these two expressions equal to each other, since the physical dimensi
Then we can rearrange terms to express φ (phi), the degree rotation of the roller, in terms of θ, the degree distance between (a) and (b). Then we can rearrange terms to express φ (phi), the degree rotation of the roller, in terms of θ, the degree distance between (a) and (b).
Here it is: Here it is:
> φ = θR<sub>p/R<sub>r</sub>. > φ = θR<sub>p</sub>/R<sub>r</sub>.
This rotation expression is very convenient. This rotation expression is very convenient.
If we know how many times we want to photograph the roller on its way around the pipe, we can calculate 8, the degree distance between stoppings, by dividing 360 by the number of stoppings. If we know how many times we want to photograph the roller on its way around the pipe, we can calculate θ, the degree distance between stoppings, by dividing 360 by the number of stoppings.
And knowing the radius of the pipe and of the roller, we can use the tidy expression above to calculate <P, the relative rotation of the roller from one stopping point to the next. And knowing the radius of the pipe and of the roller, we can use the tidy expression above to calculate φ, the relative rotation of the roller from one stopping point to the next.
So much for the roller talk. So much for the roller talk.
But before we go on to the turtle walk, will you admit that you know more about this problem than you thought you knew at the outset? But before we go on to the turtle walk, will you admit that you know more about this problem than you thought you knew at the outset?
Listen: breaking big problems down into smaller ones makes getting Listen: breaking big problems down into smaller ones makes getting started easier.
Visual Modeling
( a. )
41
Chapter 2
started easier.
And once you get started moving in any direction, you will discover that you are already familiar with much of the scenery. And once you get started moving in any direction, you will discover that you are already familiar with much of the scenery.
A turtle walk around the pipe
Remember that a turtle- walk scenario describes in words and sketches how you want the turtle to walk through a design. ### A turtle walk around the pipe
Remember that a turtle-walk scenario describes in words and sketches how you want the turtle to walk through a design.
Let yourself go, but be specific. Let yourself go, but be specific.
Addressing your instructions to the turtle and talking out loud may be helpful. Addressing your instructions to the turtle and talking out loud may be helpful.
Let's use the sketches on the next page as the focal point of this scenario. Let's use the sketches on the next page as the focal point of this scenario.
I have divided my turtle walk into small scenes and have given each a letter designa tion. I have divided my turtle walk into small scenes and have given each a letter designation.
The previous shapes in this section were drawn with Logo procedures, but I have intentionally left the following figures in freehand form; they are taken from my own Logo notebook. The previous shapes in this section were drawn with Logo procedures, but I have intentionally left the following figures in freehand form; they are taken from my own Logo notebook.
I wanted to remind you that sketches come before Logo procedures that draw rounder circles. I wanted to remind you that sketches come before Logo procedures that draw rounder circles.
The following sketches record my visual doodling about this particular problem. The following sketches record my visual doodling about this particular problem.
But to appreciate the usefulness of sketches, you must do some yourself. But to appreciate the usefulness of sketches, you must do some yourself.
Don 't just look at my examples. Don't just look at my examples.
Because sketches can be effective visual aids for careful thinking, they need to be drawn carefully. Because sketches can be effective visual aids for careful thinking, they need to be drawn carefully.
I occasionally use rulers and a compass, but not always. I occasionally use rulers and a compass, but not always.
Of course, the small diagrams on the next page are final sketches, not beginning ones. Of course, the small diagrams on the next page are final sketches, not beginning ones.
Final drawings, like final Logo procedures, are the results of many preliminary studies, many of which did not "work out properly." Final drawings, like final Logo procedures, are the results of many preliminary studies, many of which did not "work out properly."
Word description of the turtle walk
DiagramA: Qrawingthe~i~e ### Word description of the turtle walk
#### Diagram A: Drawing the pipe
Begin at position (1) facing straight up. Begin at position (1) facing straight up.
Draw a circle around point (1) with radius Rp. Draw a circle around point (1) with radius R<sub>p</sub>.
This will be easyto do using CNGO.N(This procedureis listed below, but seeChapter1 for a full descriptionof it. This will be easyto do using `cngon`.
Think of it asa black-box procedure (This procedure is listed below, but see Chapter1 for a full description of it.
42 Think of it as a black-box procedure
D. DIAGRAMS A through H: Turtle walk sketches of the roller-pipe machine.
F.
q G.
H.
E.
machine
VisualModeling
43
Turtle-walk sketches of the roller-pipe
.'-' J>".,'.',
...,....,..,'
,,.
", ~. 'D>...:..... ' ".' "'""',
I""
- "v,,-, \....". ~ '
'-../..,. ""-'.,,
.,..'
1111 that draws regular polygons around a central point.
~ MOU ld2uoI O JeldE4~ `cngon` takes two arguments: `n`, the number of sides of the polygon to be drawn, and `rad`, the radius of the circle that circumscribes the polygon. For example, `cngon (20, 60)` would draw a circle--a 20-sided polygon--of radius 60.
Aue al pue The turtle's current position defines the _center_ around which the polygon would be drawn.)
S o
: a1l1 E sau a1.I~ a ~t?l ~snln ~unOUle UO !~e~Ol dq ~d~elrole.UMElp !a aqa4 P~lnoJMD aD u~oa4~ A~loldiD liaD1l1!1!qSJrDqaM ~Sallpu!{Jn~S~~OU!lEl!iM!elJplJa1nUD3l lO:J a]a14l1UO~ ~!~Uele!aMaElalapal {SU:g!!UIalrWa!rJllEol2aEle.I allna!Ol}OA{}~O~uaUlo!~{!UM}a!s!oUlaO !~1!:us:o)d!arauoelS!~l{'sJ1e}0x!1aGu ~ lanOl
G
MElp
Jo s1uawn
PlnoM
Sn !pEl
~ lE
09 a1l1
OM }
Sa ){E1 NO ~ N:) 1U !od.IEl:JuaJ E punolE suo ~ Alod sell ldIIOl dq ~ dSne; ) dH.
MO paAour 1aA 10U sell laIIol al snUl noA ()~u!od~V.()UO !a all } Jo.Ia }uaJ all } O
!JapUO!1!sod 1UallnJ
~ ~UnOUle dUlOS pdUln ~ dq II !M s.aNlm~a(lZl1)-uo.09!~!sSond!pEuloJpoala-u~OUa~;A)lol(dZ~)SUnOpap!!p1t!s!?osld-JoOz:uraOEplJl-!a;I2J)ult?!!1MJlet?~lpSMOMlloEN a,ll~{1M+elOd~S'!2ua;!)JuetJ?~sale!PnOAl{J!l{MU!UO aa
OU II ! M MOlle dq ~ ' ( Z ) OZ NO~N:):aldwExa !1.I.L 'lallol a1.I~ Jo la ~Ua ;) a1.I~ I(Z) uo !~!sod o ~ aAOW put? dn uad a1.I~ ~ ;)!d '~xa N MOlle lad.uO~Alod a1l1{1saqS!!l1JeSlWn{J1lpue!J'1dEn1l11laI{J2l!e!lJ1S 2U!1(U1)!oudo !U}M!esolpd 'adaq!duaetJ{}JMoOll.eIa}uaJal{a1t{'}aJOua}H){Jeq.
l
'av ~ PUE 'UMElP aq 01 UO ~Alod a1l1 Jo sapuop!s Jo~Iuslealqwnu{ 1! 'UOa1!l11!so'dN 2u !1le1S al {1 urOlJ aa
'
lEln ~ al SMElp
1E1l1
'
(
Visual Modeling #### Diagram B: Drawing the roller in its first position on the top of the pipe
Diagram F: Orientintgherolleranddrawingthearrow Next, pick up the pen and move to position (2), the center of the roller.
This distance is R<sub>p</sub> + R<sub>r</sub>.
Now draw a circle of radius R<sub>r</sub> centered on position (2) to illustrate the roller.
#### Diagram C: Orienting the roller in preparation for drawing the arrow
Since the roller has not yet moved from the starting position, it hasn't done any rolling.
Hence, the arrow can be drawn poiunting straight up, and that is the direction in which you are facing.
Draw the arrow starting from position (2) and get back to this position when you are finished.
#### Diagram D: Getting back to the center of the pipe
Pick up the pen and move back to the center of the pipe, position (1).
#### Diagram E: Getting to the next stopping position of the roller
Turn left by angle θ, and go forward to position (3).
At point (3) you must correctly orient the roller before drawing the arrow.
Because the roller has now rolled a bit to the left of its starting position at point (2), the arrow will no longer point in the same direction as the line: (1) to (3).
It will be turned some amount to the left of it.
What must you take into account to calculate the rotation amount?
#### Diagram F: Orienting the roller and drawing the arrow
The roller has moved from position (2) to position (3) by rotating about its own center. The roller has moved from position (2) to position (3) by rotating about its own center.
We used the symbol <I>to indicate this rotation. We used the symbol φ to indicate this rotation.
The angle <I>is measured relative to the dotted line linking the centers of the pipe and roller: (1) to (3). The angle φ is measured relative to the dotted line linking the centers of the pipe and roller: (1) to (3).
You have arrived at position (3), pointing along the axis (1) to (3). If you now turn left by angle <I>= 8Rp/ Rr, you will be facing in the correct direction to draw the arrow. You have arrived at position (3), pointing along the axis (1) to (3).
If you now turn left by angle φ=θR<sub>p</sub>/R<sub>r</sub>, you will be facing in the correct direction to draw the arrow.
Draw the roller circle, too. Draw the roller circle, too.
DiagramG: Gettingbacktothecenteorfthe12i12e
Turn right by 4>, pick up the pen, and move back down to (1).
DiagramH: Pre~aringforthenextrollersto~~ing~osition
Get ready to draw the next roller image: turn left by angle 8 and move out to position ( 4 ). The roller rotation angle at the point ( 4 ) is again measured relative to the dotted line linking points (1) to (4). Why?
Angle cj> at position ( 4 ) equals 28Rp / Rr Why 28? Because cj> must be cal- culated relative to the starting position, and the roller has moved 28 degrees
from the starting position ( 2 ). Turtle: you may now turn left arrow, turn right by cj>, and go back down to the center of the pipe.
Angle cj> at the next stopping position ( 5 ) is not shown in the will be 38Rp / Rr Why?
Ora w a few diagrams to convince yourself back and look at the figures on page 40 for some help.
A turtle walk transfonned into Logo procedures by cj>, draw the diagrams.
But it of all this.
Go
To start, recall that we have to glue an arrow onto the face of the roller.
So let 's write a procedure to draw an arrow of any shaft length: L.
45
Chapter2 #### Diagram G: Getting back to the center of the pipe
SHAFT Turn right by φ, pick up the pen, and move back down to (1).
TO ARROW:L
; To draw a simple arrow of shaft; each tip is given by.2*:L. #### Diagram H: Preparing for the next roller stopping position
; PD FD:L Get ready to draw the next roller image: turn left by angle θ and move out to position (4).
LT 140 FD.2*:L BK.2*:L The roller rotation angle at the point (4) is again measured relative to the dotted line linking points (1) to (4).
RT 280 FD.2*:L BK.2*:L LT 140 BK:L Why?
PU
END Angle φ at position (4) equals 2θR<sub>p</sub>/R<sub>r</sub>.
PIPEGONs length Why 2θ?
:L. Because φ must be calculated relative to the starting position, and the roller has moved 2θ degrees from the starting position (2).
The length of Turtle: you may now turn left by φ, draw the arrow, turn right by φ, and go back down to the center of the pipe.
Let's call the procedure that will carry out this turtle walk PIPEGON.
Angle φ at the next stopping position (5) is not shown in the will be 3θR<sub>p</sub>/R<sub>r</sub>.
Why?
Draw a few diagrams to convince yourself of all this.
Go back and look at Figures 7 and 8 for some help.
### A turtle walk transfonned into Logo procedures
To start, recall that we have to glue an arrow onto the face of the roller.
So let's write a procedure to draw an arrow of any shaft length `len`.
##### Figure 10: Shaft/arrow diagrams
```
fn arrow! (len) -> {
& To draw a simple arrow of shaft; each tip is given by len * 0.2.
pendown! ()
forward! (len)
let tip_angle = 0.4
let tip_len = mult (0.2, len)
left! (tip_angle)
forward! (tip_len)
back! (tip_len)
right! (mult (tip_angle, 2))
forward! (tip_len)
back! (tip_len)
left! (tip_angle)
back! (len)
}
```
### `pipegon!`s
Let's call the procedure that will carry out this turtle walk `pipegon!`.
What will be the arguments? What will be the arguments?
Certainly the radius of the pipe and the radius of the roller will be needed. Certainly the radius of the pipe and the radius of the roller will be needed.
We will also need to know e and how many stopping points we would like to photograph. We will also need to know e and how many stopping points we would like to photograph.
Here is the list of arguments so far: Here is the list of arguments so far:
: RP, the radius of the pipe: RR, the radius of the roller * `pipe_rad`, the radius of the pipe
: THETA, the angle distance between stopping places: N, the number of stopping places * `roll_rad`, the radius of the roller
Let's add one more,: CUM, that will keep track of the total of the angle turned from the starting roller position. * `theta`, the angle distance between stopping places
We can now write the first line of PIPEGON: * `n`, the number of stopping places
TO PIPEGON:RP:RR:THETA:CUM:N 46
Let's add one more, `total_angle`, that will keep track of the total of the angle turned from the starting roller position.
We can now write the first line of `pipegon!`:
```
fn pipegon! (pipe_rad, roll_rad, theta, total_angle, n) ->
```
How do you feel about rushing right into doing the rest? How do you feel about rushing right into doing the rest?
The following is not my first " rush " or even the second. The following is not my first "rush" or even the second.
My first few attempts had bugs in them, and they didn 't work as I had planned. My first few attempts had bugs in them, and they didn't work as I had planned.
But procedures almost never work the first time. But procedures almost never work the first time.
That 's OK as long as your energy is up to fixing them. That's OK as long as your energy is up to fixing them.
TO PIPEGON:RP:RR:THETA:CUM:N
IF:N<1[CNGON20:RPSTOP] PUFD:RP+:RRPD ```
LT:CUM*:RP/:RR ARROW:RR*1.5 fn pipegon! (pipe_rad
CNGON20: RR roll_rad
RT =CUM* =RP/ =RR theta
PUBK:RP+:RR total_angle
LT:THETA n) -> {
PIPEGON:RP:RR:THETA (:CUM+:THETA) if lt? (n, 1) then cngon! (20, pipe_rad)
(:N- l ) else {
on the of the penup! ()
Visual Modeling forward! (add (pipe_rad, roll_rad))
END pendown! ()
Supporting procedures left! (mult (total_angle, div (pipe_rad, roll_rad)))
TO CNGON. arrow! (mult (1.5, roll_rad))
: N cngon! (20, roll_rad)
: RAD an N- position rt! (mult (total_angle, div (pipe_rad, roll_rad)))
, penup! ()
, back! (add (pipe_rad, roll_rad))
To draw current sided polygon left! (theta)
RAD is the centered turtle circle pipegon! (pipe_rad
' s that roll_rad
. theta
. add (total_angle
. theta)
radius dec (n))
, would pass through all of the polygon 's vertices. }
. }
, See Chapter 1 for a full PU FD: RAD ```
RT180-(90*(:N-2)/:N)PD description of
CNGON ### Supporting procedures
. ```
NGON: N ( 2 *: RAD * SIN ( 180 LT 180- (90*(:N-2)/:N) fn ngon! (n, edge) -> {
/: N & To draw an `n`-sided polygon. The first *edge* will be
TO NGON:N & drawn *from* the turtle's current position, and its length
END & is given by `edge`.
Some pip repeat n {
; To forward! (edge)
; drawn right! (inv (n))
; is }
REPEAT draw given }
. egon from
: N by fn cngon! (n, radius) -> {
[ FD productions & To draw an `n`-sided polygon *centered* on the turtle's
PU BK END & current position. `radius` is the radius of the circle that
: RAD & would pass through all of the polygon's vertices.
PD & See Chapter 1 for a full description of `cngon!`.
: EDGE an let angle = add (inv (4), inv (mult (2, n)))
I typed let edge = mult (2, radius, sin (inv (mult (2, n))))
PIPEGON
N- sided polygon the turtle 's current position, and its length penup! ()
EDGE. forward! (radius)
:EDGE RT360/:N] right! (angle)
60 30 60 0 6. This models, in a visual way, the rolling of a pendown! ()
. The first edge will be ngon! (n, edge)
47 left! (angle)
penup! ()
back! (radius)
pendown! ()
}
```
### Some `pipegon!` productions
I typed `pipegon! (60, 30, inv (6), 0, 6)`. This models, in a visual way, the rolling of a roller of radius 30 around the circumference of a 60 radius pipe.
The roller stops along the circumference every sixth turn, and 6 rollers will be drawn.
The argument `total_angle` is given an initial value of 0.
What is `total_angle` being used for?
What happens if you begin with some other value, say 0.12?
##### FIGURE 11: Up-and-down `pipegon!`
Chapter2
roller of radius 30 around the circumference of a 60 radius pipe.
The roller stops along the circumference every 60 degrees, and 6 rollers will be drawn.
The argu- ment: CUMis given an initial value of o.
What is: CUMbeing used for?
What happens if you begin with some other value, say 43.5?
~
One last point. One last point.
In my turtle-walk scenario I drew the pipe circle before doing anything else. In my turtle-walk scenario I drew the pipe circle before doing anything else.
The procedure PIPEGONdraws it last. The procedure `pipegon!` draws it last.
Why did I change the order of things? Why did I change the order of things?
Well, I wanted to use recursion and to be able to specify the number of times recursion would happen. Well, I wanted to use recursion and to be able to specify the number of times recursion would happen.
I used the argument: N to take care of this. I used the argument `n` to take care of this.
PIPEGON's first line looks at the current value of: N; when: N"becomes zero, PIPEGON should be stopped. `pipegon!`'s first line looks at the current value of `n`; when `n` "becomes zero, `pipegon!` should be stopped.
It is easier to know when a procedure should be stopped than when it has just begun, and this seemed a nice place to draw the pipe, after all the rollers had been drawn. It is easier to know when a procedure should be stopped than when it has just begun, and this seemed a nice place to draw the pipe, after all the rollers had been drawn.
Could you reorganize the procedure to draw the pipe before drawing any of the rollers? Could you reorganize the procedure to draw the pipe before drawing any of the rollers?
Exploring PIPEGONdynamics
One of the pleasures of modeling is playing with the little model you have 48
Visual Modeling ### Exploring `pipegon!`dynamics
built. One of the pleasures of modeling is playing with the little model you have built.
Let's fiddle with PIPEGON's parts to seewhat happens. Let's fiddle with `pipegon!`'s parts to seewhat happens.
I will show you only a few things to give you the idea. I will show you only a few things to give you the idea.
Let's start with some different argument values. Let's start with some different argument values.
Here is the portrait of PIP EGaN 60 30 2 0 180.
But I don 't like all those circles. Here is the portrait of `pipegon! (60, 30, inv (180), 0, 180)`.
So I removed PIPEGON's third line.
##### FIGURE 12: Many-arrowed-and-circled `pipegon!`
But I don't like all those circles.
So I removed `pipegon!`'s twelfth line.
Here is the new version. Here is the new version.
The asterisks ( * * * ) mark where the line was removed from the original version of the procedure. The commented line marks where the line was removed from the original version of the procedure.
Don 't type them, though.
TO A.PIPEGON:RP:RR:THETA:CUM:N ```
; Arrow- only pipegon & |- arrow-only pipegon
IF:N<1[CNGON20:RPSTOP] PUFD:RP+:RRPD fn a_pipegon! (pipe_rad & <-- note the new name
LT:CUM*:RP/:RR ARROW: RR* 1. 5 roll_rad
(***) <--- RT:CUM*:RP/:RR theta
PU BK:RP +:RR total_angle
LT: THETA n) -> {
A.PIPEGON:RP:RR:THETA(:CUM+:THETA) (:N-l)<--- END new name removed newname if lt? (n, 1) then cngon! (90, pipe_rad)
line else {
49 penup! ()
forward! (add (pipe_rad, roll_rad))
pendown! ()
left! (mult (total_angle, div (pipe_rad, roll_rad)))
arrow! (mult (1.5, roll_rad))
&&& LINE REMOVED: cngon! (90, roll_rad)
rt! (mult (total_angle, div (pipe_rad, roll_rad)))
penup! ()
back! (add (pipe_rad, roll_rad))
left! (theta)
a_pipegon! (pipe_rad & <-- note the name changed here
roll_rad
theta
add (total_angle
theta)
dec (n))
}
}
```
Now this is a portrait of `a_pipegon! (60, 30, inv (180), 0, 180)`.
##### FIGURE 13: Arrow-only `a_pipegon!`
Instead of drawing an arrow on the roller, let's draw a stripe along a diameter.
We can use `cngon!` to draw a two-sided polygon with radius equal to the roller.
We take out the `arrow!` procedure and insert `cngon!`.
Chapter2
Now this is a portrait of A.PIPEGON 60 30 2 0 180.
Instead of drawing an arrow on the roller, let 's draw a stripe along a diameter.WecanuseCNGONtodraw atwo-sidedpolygon with radius equalto the roller.
We take out the ARROWprocedure and insert CNGON.
Here it is: Here it is:
TO S.PIPEGON:RP:RR:THETA:COM:N ;.s..triped pipegon ```
IF:N < 1 [CNGON 20:RP STOP ] & |- stripe-pipegon
PO FD:RP +:RR PD fn s_pipegon! (pipe_rad & <-- note another new name
<--- roll_rad
new name theta
LT: COM *: RP /: RR total_angle
(***) n) -> {
CNGON 2:RR if lt? (n, 1) then cngon! (90, pipe_rad)
RT: COM *: RP /: RR else {
PO BK:RP +:RR penup! ()
LT: THETA forward! (add (pipe_rad, roll_rad))
S. pendown! ()
PIPEGON: RP: RR left! (mult (total_angle, div (pipe_rad, roll_rad)))
END cngon! (2, roll_rad) & <-- removed the call to `arrow!`
<--- ARROW removed rt! (mult (total_angle, div (pipe_rad, roll_rad)))
: THETA penup! ()
) (: N- l ) back! (add (pipe_rad, roll_rad))
<--- left! (theta)
new name s_pipegon! (pipe_rad & <-- new name
<--- 2- sided roll_rad
(: COM +: THETA theta
CNGON installed here add (total_angle
50 theta)
dec (n))
}
}
```
And here is a portrait of `s_pipegon! (60, 30, inv (180), 0, 180)`.
*********
HERE IS WHERE I STOPPED ON 2025-01-02
*********
And here is a portrait of s.PIPEGON 60 30 2 0 180.
Now, imagine an invisible arrow glued to the front of the roller. Now, imagine an invisible arrow glued to the front of the roller.
At the tip, there is a flashing light. At the tip, there is a flashing light.
Here is the new part to fit into our PIPEGONmachine: Here is the new part to fit into our `pipegon!`machine:
TO FLASH:L TO FLASH:L
; Flashes a light at distance:L from the starting point,; and returns the turtle to where it started. ; Flashes a light at distance:L from the starting point,; and returns the turtle to where it started.
PU FD:L PD PU FD:L PD
REPEAT6 [FD 2 BK 2 RT 60] REPEAT6 [FD 2 BK 2 RT 60]
PU BK:L PD END PU BK:L PD END
To install FLASH into PIPEGON, we could fix a value for: L, perhaps based on the value for: RR. To install FLASH into `pipegon!`, we could fix a value for: L, perhaps based on the value for: RR.
Or we could extend PIPEGONby adding another argument. Or we could extend `pipegon!`by adding another argument.
<--- FLASH installed. <--- FLASH installed.
CNGONremoved CNGONremoved
<--- <---
Visual Visual
Modeling Modeling
Call the extension L. Call the extension L.
PIPEGON. `pipegon!`.
TO L. TO L.
PIPEGON: RP: RR: L `pipegon!`: RP: RR: L
: THETA : THETA
: CUM : CUM
: N `n`
IF:N < 1 [CNGON 20:RP STOP ] PU FD:RP +:RR IF:N < 1 [CNGON 20:RP STOP ] PU FD:RP +:RR
LT:CUM *:RP /:RR LT:CUM *:RP /:RR
FLASH (***) FLASH (***)
: L : L
RT:CUM *:RP /:RR PU BK:RP +:RR LT: THETA RT:CUM *:RP /:RR PU BK:RP +:RR LT: THETA
L. L.
PIPEGON: RP `pipegon!`: RP
<--- new name and arg <--- new name and arg
PD PD
:RR:L:THETA (:CUM+:THETA) <--- :RR:L:THETA (:CUM+:THETA) <---
@ -449,7 +492,7 @@ END
51 51
Chapter 2 Here is the flash portrait of: Chapter 2 Here is the flash portrait of:
L.PIPEGON 60 30 40 2 0 180 L.`pipegon!` 60 30 40 2 0 180
~.~*"'*.~- ~.~*"'*.~-
*--. *--.
.- ~~ .- ~~
@ -466,7 +509,7 @@ L.PIPEGON 60 30 40 2 0 180
~ ~ ~ ~
-* *- ".~..*,,".~" -* *- ".~..*,,".~"
.."" ..""
L.PIPEGON 60 30 L.`pipegon!` 60 30
- 40 - 40
2 0 180 2 0 180
- *-.,. - *-.,.
@ -492,7 +535,7 @@ Have you noticed that even the most complex designs we have done so far are draw
Each is complete by the time the roller has made a single 360-degree trip around the pipe. Each is complete by the time the roller has made a single 360-degree trip around the pipe.
If the roller makes a second trip around the pipe, the design repeats exactly. If the roller makes a second trip around the pipe, the design repeats exactly.
We can describe this kind of design as one that has "closed upon itself" or, more briefly, that has "closed" after one trip. We can describe this kind of design as one that has "closed upon itself" or, more briefly, that has "closed" after one trip.
Not all designs produced by our PIPEGONmachine will close after only one trip; some will take several trips to close, and others will require a great number of trips. Not all designs produced by our `pipegon!`machine will close after only one trip; some will take several trips to close, and others will require a great number of trips.
Experiments will show that altering the sizes of the roller and pipe leads to different closure patterns. Experiments will show that altering the sizes of the roller and pipe leads to different closure patterns.
What determines the number of trips before closure occurs? What determines the number of trips before closure occurs?
Can you calculate the trips until closure if you know the sizes of the roller and pipe? Can you calculate the trips until closure if you know the sizes of the roller and pipe?
@ -504,7 +547,7 @@ A portfolio of roller-inside-pipe portraits
53 53
Chapter 2 Chapter 2
On the next page is a PIPEGON design that closes only after a number of trips around the pipe. On the next page is a `pipegon!` design that closes only after a number of trips around the pipe.
The individual images show the design at various trip stagesaround the pipe. The individual images show the design at various trip stagesaround the pipe.
Can you guess the pipe and roller sizes I used? Can you guess the pipe and roller sizes I used?
Words elicit images Words elicit images
@ -523,11 +566,11 @@ By the way, you probably won 't find closure in a standard dictionary.
Why is this? Why is this?
At the start of this chapter I mentioned that sometimes we would model machines from the real world- pipes and rollers are very real world- and other times we would model machines that aren 't so real. At the start of this chapter I mentioned that sometimes we would model machines from the real world- pipes and rollers are very real world- and other times we would model machines that aren 't so real.
Perhaps we can make one model do both real and imaginary things. Perhaps we can make one model do both real and imaginary things.
For example, can we make our PIPEGON machine draw some fantastic designs? (By the way, look at that word imaginary. For example, can we make our `pipegon!` machine draw some fantastic designs? (By the way, look at that word imaginary.
Why does it have image in it? Why does it have image in it?
Can you imagine why?) Can you imagine why?)
Let 's imagine a striped roller inside a pipe. Let 's imagine a striped roller inside a pipe.
The procedure PIPEGON will generate a composite picture of this roller as it travels around the inside of a pipe. The procedure `pipegon!` will generate a composite picture of this roller as it travels around the inside of a pipe.
So far, this is just like the situations viewed above. So far, this is just like the situations viewed above.
But now, let 's introduce the fantasy feature. But now, let 's introduce the fantasy feature.
Make the radius of the roller larger than the Make the radius of the roller larger than the
@ -565,7 +608,7 @@ I could have used any number of alternative illustrations, but this was my own d
I will show you, in the chapters to come, dozens of other examples that illustrate the ways in which visual modeling encourages the modeler to look at the world differently. I will show you, in the chapters to come, dozens of other examples that illustrate the ways in which visual modeling encourages the modeler to look at the world differently.
56 56
Imaginary PIPEGONs? Imaginary `pipegon!`s?
:11,/Ill :11,/Ill
S// S//
/ I] / I]
@ -577,12 +620,14 @@ Visual Modeling
){ooq S!l{101aA!1EU)l!a1a?~Itl.{il~to!?aMa~1~!lJUMoa~'IS0.!l1OSnUMoOaAJlI'1IaU~:SE?tM1ln!SJ1I!u~1laEJ!JauSJ!JSA'aCIalald~~onaJlO passaldxa AnEqlaA '~no pa~JE AI~!J!I.saldillt?xa liMO lnOA l{~noll {1'l{Jt?olddt?liMO lnOA PpUa!~JE0ln1wploaJ~t?lnAOI~J!JU!Iadaxaq II'!lOM!AEl{aq JO aSlnOJ E ~lEllJ o~ 'OO~ SIEW!UE la ){ooq S!l{101aA!1EU)l!a1a?~Itl.{il~to!?aMa~1~!lJUMoa~'IS0.!l1OSnUMoOaAJlI'1IaU~:SE?tM1ln!SJ1I!u~1laEJ!JauSJ!JSA'aCIalald~~onaJlO passaldxa AnEqlaA '~no pa~JE AI~!J!I.saldillt?xa liMO lnOA l{~noll {1'l{Jt?olddt?liMO lnOA PpUa!~JE0ln1wploaJ~t?lnAOI~J!JU!Iadaxaq II'!lOM!AEl{aq JO aSlnOJ E ~lEllJ o~ 'OO~ SIEW!UE la
SnO!AqoosaqII!Ms!l[1JossaulnJasnal{11t?l{1ado{~l{PIU.ESJ'!Ul[EdWt?ls~alpquEtu?a2u~E!IlalMpoaillE Aall]. 'PIlOM all~2u!nl~suOJJoSAEMalE,,- sIap SnO!AqoosaqII!Ms!l[1JossaulnJasnal{11t?l{1ado{~l{PIU.ESJ'!Ul[EdWt?ls~alpquEtu?a2u~E!IlalMpoaillE Aall]. 'PIlOM all~2u!nl~suOJJoSAEMalE,,- sIap
?ns!A 01l{Jt?olddt?dUO'AlaS!Jald AlaA 'nOAMOl{-SS0~1JnSl!~SuUOO!1Juaas1alul!].AW'S]3POUlsula~~Ed asal{~paIIEJ aAEl{ naM SE~snf PlnoJ, ?ns!A 01l{Jt?olddt?dUO'AlaS!Jald AlaA 'nOAMOl{-SS0~1JnSl!~SuUOO!1Juaas1alul!].AW'S]3POUlsula~~Ed asal{~paIIEJ aAEl{ naM SE~snf PlnoJ,
az!s lOJ uo iCl~ aldoad ~El{~ sula ~~Ed al{~ o~ SlJn.llSUOJaWEU al{~ saA!2 Ana)! ZU1JJS01 1.fJvo.Jddv.n1.Jn.JIs V S! ){ooq al{1Jo aN!1qnsal{11E{l1IIt?Ja~.UO!l{st?J p,a'nlnE1~JEn2l1uS!l{f~..o1uaAUEl{~InJdlal { alOW S! ~!Jload EuaAH '~! JOasuas az!s lOJ uo iCl~ aldoad ~El{~ sula ~~Ed al{~ o~ SlJn.llSUOJaWEU al{~ saA!2 Ana)!
ZU1JJS01 1.fJvo.Jddv.n1.Jn.JIs V S! ){ooq al{1Jo aN!1qnsal{11E{l1IIt?Ja~.UO!l{st?J p,a'nlnE1~JEn2l1uS!l{f~..o1uaAUEl{~InJdlal { alOW S! ~!Jload EuaAH '~! JOasuas
?U! sla1dt?l{J asal{1paJnpOl1u! put?palaplo aAt?l{ I )p{EutW?sol~a1adlqEtupnJ!SJ!JUaEdWs U~E!ll{1~!M~ !aua20wol { pa~E!~UalaJJ!pUn UEl{Jns aq o~SlEa. ?U! sla1dt?l{J asal{1paJnpOl1u! put?palaplo aAt?l{ I )p{EutW?sol~a1adlqEtupnJ!SJ!JUaEdWs U~E!ll{1~!M~ !aua20wol { pa~E!~UalaJJ!pUn UEl{Jns aq o~SlEa.
!JlaXa Aill paJt?Id AllnJalt?J aAt?l{ I.Alt?l1!qlt?IOUS!a){l{o~osqulaS!l~{~1EdU!l{JSnasS!J~nlaOXl{a~!M ~aA 'po02 iClaASAEMIE~ou S! ~!JalI.1'pasodw {1Jo~U!laplOal{1'laAaMoH.s1uapmSAillJos1S!aPlaIl1O!uMal{1alp{u~tl?{sJ1!lS{MalaJ1O!ulsiMa!O~!IEolal{~laAO~!Jo~s~dwa~~Eual{~PUESa~ UOpast?q alt?SaS!JlaXaal{1JOIIV.pU!ill U! ~U!MOIIlo{J!al\{.{M1dsa~al)d{waast?~aldO1snugla ~~Ed ~ualEdsuEl ~l{2nollI ~PIloM s!l{ ~ES){OOIUEW" !JlaXa Aill paJt?Id AllnJalt?J aAt?l{ I.Alt?l1!qlt?IOUS!a){l{o~osqulaS!l~{~1EdU!l{JSnasS!J~nlaOXl{a~!M ~aA 'po02 iClaASAEMIE~ou S! ~!JalI.1'pasodw {1Jo~U!laplOal{1'laAaMoH.s1uapmSAillJos1S!aPlaIl1O!uMal{1alp{u~tl?{sJ1!lS{MalaJ1O!ulsiMa!O~!IEolal{~laAO~!Jo~s~dwa~~Eual{~PUESa~ UOpast?q alt?SaS!JlaXaal{1JOIIV.pU!ill U! ~U!MOIIlo{J!al\{.{M1dsa~al)d{waast?~aldO1snugla ~~Ed ~ualEdsuEl ~l{2nollI ~PIloM s!l{ ~ES){OOIUEW"
' '
s~s!~ua !Js SE aldoad lIE paMa !A A ~JEJUI 's~s!~ua!Js Aq pasn asol{~o~lEI!W!SalE ~El{~sanb!ul{Ja~2u!sn PIlOM S! a){EW o~Sa!l ~uoslad l{JEa ~El{~Ma!A S!l{ wall saWOJ awEJ o~W!EIJ S,A s~s!~ua !Js SE aldoad lIE paMa !A A ~JEJUI 's~s!~ua!Js Aq pasn asol{~o~lEI!W!SalE ~El{~sanb!ul{Ja~2u!sn PIlOM S! a){EW o~Sa!l ~uoslad l{JEa ~El{~Ma!A S!l{ wall saWOJ awEJ o~W!EIJ S,A
A20IOl{JAsd PUE 'A20IO!JOS 'SJ!SAlld 'SJ!~Ewal {~Ew U! paU!El~ SEM 5'06 )! U! A20IOl{JAsd PUE 'A20IO!JOS 'SJ!SAlld 'SJ!~Ewal {~Ew U! paU!El~ SEM 5'06 )!
U!
UlOq 'Ana)! a2loa ~ '2u !PI!nq Iapow ~noqE 2u !){U!l{~UMO AW paJuan ~Eal2 SEll Ol{M ~s!20IOl{JAsd UEJ!lawy U.EJo ){lOM al{~noA o~2U!JnpOl ~U UlOq 'Ana)! a2loa ~ '2u !PI!nq Iapow ~noqE 2u !){U!l{~UMO AW paJuan ~Eal2 SEll Ol{M ~s!20IOl{JAsd UEJ!lawy U.EJo ){lOM al{~noA o~2U!JnpOl ~U
~lnJ 02 aw ~aI '~uawnJop IEuoslad AlaA E S! ){ooq s!l{~~El{~pa~~!WpE 2U! ~lnJ 02 aw ~aI '~uawnJop IEuoslad AlaA E S! ){ooq s!l{~~El{~pa~~!WpE 2U!
@ -606,12 +651,13 @@ Obviously, I need words, too, to help in my form of elicitation.
Sometimes, you may think that I rely on words too much. Sometimes, you may think that I rely on words too much.
Too much chat, you might say... Too much chat, you might say...
If you are intrigued by this very brief account of George Kelly 's work, find his book A Theory of Personality: the psychology of personal constructs (W. If you are intrigued by this very brief account of George Kelly 's work, find his book A Theory of Personality: the psychology of personal constructs (W.
W. Norton, New York, 1963). All the Kelly quotes were taken from it. W. Norton, New York, 1963).
All the Kelly quotes were taken from it.
59 59
Chapter2 Exercises Chapter2 Exercises
Exercis2e.1 Exercis2e.1
Can you come up with some rules about PIPEGON closure? Can you come up with some rules about `pipegon!` closure?
Specifically, can you characterize a final pipegon image in terms of the dimensions of its parts? Specifically, can you characterize a final pipegon image in terms of the dimensions of its parts?
Experiment a bit. Experiment a bit.
Try to make some generalizations. Try to make some generalizations.
@ -660,4 +706,4 @@ The French sculptor Jean Tinguely does kinetic sculpture on a more modest scale.
Below is a reproduction of his " Homage a Marcel Duchamp," done in 1960. It is human scale, about 5 feet high. Below is a reproduction of his " Homage a Marcel Duchamp," done in 1960. It is human scale, about 5 feet high.
Design and build a kinetic sculpture using Logo. Design and build a kinetic sculpture using Logo.
You might start by trying to model the Tinguely machine. You might start by trying to model the Tinguely machine.
PIPEGONsare a kind of kinetic sculpture, too. `pipegon!`sare a kind of kinetic sculpture, too.