Computables of Architectural Design: Chapter 3

For Internal UVa. Use Only:
Funded by a Teaching and Technology Initiative Grant 1996 - 97
Draft: January 15, 1997
Copyright © 1997 by Earl Mark, University of Virginia, all rights reserved.
Disclaimer

"We ought to observe that even the things which follow after the things which are produced according to nature contain something pleasing and attractive. For instance, when bread is baked some parts are split at the surface, and these parts which thus open, and have a certain fashion contrary to the purpose of the baker's art, are beautiful in a manner, and in a peculiar way excite a desire for eating. And again, figs, when they are quite ripe, gape open, and in the ripe olives the very circumstances of their being near to rottenness adds a peculiar beauty to the fruit. And the ears of corn bending down, and the lion's eyebrows, and the foam which flows form the mouth of wild boars, and many other things -though they are far from being beautiful, if a man should examine them severally -still, because they are consequent upon the things which are formed by nature, help to adorn them, and they please the mind; so that if a man should have a feeling and deeper insight with respect to things which are produced in the universe, there is hardly one of those which follow by way of consequence which will not seem to him to be in a manner disposed so as to give pleasure. And so he will see even the real gaping jaws of wild beasts with no less pleasure than those which painters and sculptors show by imitation; and in an old woman and an old man he will be able to see a certain maturity and comeliness; and the attractive loveliness of young persons he will be able to look on with chaste eyes; and many such things will present themselves, not pleasing to every man, but to him only who has become truly familiar with nature and her work". [Meditations of Marcus Aurelius, The Harvard Classics, Translation by George Long, New York: P.F. Collier & Sons, 1937].

Relations Among Parts of a Graphic Figure

The previous chapter examined the nature of simple graphics programs and relatively straightforward data types. The oculus is a the most advanced of the graphic figures we saw, relying upon the use of several more primitive elements (e.g., lines, arcs, circle) within the procedure used to draw it. Within this chapter, we examine graphics programs that have a more advanced structure. That is, we will now begin to examine how the order of some graphic compositions might be characterized not just as a series of drawing steps, but also in terms of certain recurring relationships between its parts.

A distinction can be made between a figure that is hierarchical and one in which a different kind of ordering principle may also be found. As an example of the former case, the Euclidean geometry included by Serlio in his "flowers", such as point, line, circle, etc. are each laid out with hierarchically dependent definitions. The most primitive of these definitions is of a point as "an indivisible thing, which has in itself no dimension" We then have the basis to describe a "line as a straight and continuous representation from one point to another, having length without width". That is, the definition of a line depends upon the notion of points.

line; composed of points

We can also see a of hierarchy of descriptions further developed in the definition of "Parallels" which are dependent upon the notion of "two lines which continue at an equal distance". That is, this hierarchy consists parallels which are described in terms of lines, and in turn, lines which are described in terms of points. We add a further level to this hierarchy in the definition that a "plane is made up of two equidistant lines closed off at the sides, that is a thing which has length and breadth without depth." In other words, the hierarchy is that of a plane, which is described in terms of parallel lines, and in turn, we refer to the notion that parallel lines are described in terms of lines, and finally the notion that lines are described in terms of points.

plane; composed of parallel lines; composed of lines; composed with points.

Other kinds of graphic figure may also be broken down into parts. However, the relationship between the whole figure and its parts might be described in non-hierarchical terms. A graphic figure might consist of several equivalent parts each bearing a specified relationship to each other. We might express the relationship a number of ways. One special case is that of a recurring relation that is repeated within the graphic figure of doubling circles and squares.

Recurring Relations

We will now begin to examine in detail how the order of a specific composition might be characterized as a recurring set of relations between graphic elements. We want to describe a graphic composition composed of a series of circles and squares below as being driven by the relationship of one graphic figure to another another in a series of repeated steps.

+

Doubling of the Circle and Square Animation

From Serlio's Book on Geometry, we have a description of how to derive this proportional series of relationships between a circle and a square, and also, incidentally, a proof that one is the double of the other:

"The doubling of a circle should be done in this way. Given the small circle in a perfect square delimited by four lines A, B, C, and D, and having drawn a circle outside it which touches the four corners, the large circle will be double the smaller one.
The proof of this: if the smaller circle fitted inside a square A, B, C, D,
and the large circle fitted inside a square C, B, E, F, which is double the smaller one - as I showed above - it follows that the large circle is double he smaller one, as can be understood from the two circles K, L. "

Serlio notes practical applications of this technique in that the "The proiettura, that is the protrusion of the the Tuscan base described by Vetruvius is derived from this. It is also described where he discusses foundations which should be doubled owing to the works which go on top, because of the projections which have to rest upon the masonry." [from translation by Hart and Hicks].

A variation on this technique was the so-called secret of the medieval masons. The secret described how medieval masons would determine with string the inner proportions of a pedestal from its outer base. This basic proportion is also repeated in many other constructions, such as the proportions of a cloister walkway to the garden at the rear of a Gothic Cathedral, or in the delicate patterns of tracery in stained glass windows. The so-called secret was based on the following procedure which results in an inverse doubling of the circle and square. That is, we start with the larger figures first, and use them to develop the the inscribed figures:

 

Take a given length of string and mark off one side of a square.
Using the same length of string, mark off the additional three sides of the square.
Take two additional strings as diagonals and insure that they intersect each other at their respective midpoints. (You could imagine that a mason might fold a string in half to find its mid-point.).
Place a string form the intersection of the diagonals to the mid-point of one the sides of the square.
Rotate the length of this new string four times, marking off a point on each of the four diagonals.
These four points will determine the inner-most square.

Lets now take a look at the following animation of the so-called secret method. In this case the construction is used to develop the proportions of a pedestal to its base.

+

The Secret of the Medieval Masons Animation

Describing A Recurring Relation As An Procedure

There are a number of ways to describe the graphic figure of the doubling circles as a procedure. One method is a brute force approach. That is, we can describe the steps of this procedure as though they were each unique and bear no similarity to one another. A summary of this procedure might be:

Step 1: Draw A Circle At The Point 0.0 ,0.0 ,0.0 with Radius 4.0.
Step 2: Draw the next outer Square that circumscribes the Circle.
Step 3: Draw the next outer Circle that circumscribes the last Square
Step 4: Draw the next outer Square that circumscribes the last Circle.

The BASIC drawing program for such a procedure has the exact same organization. We can see this at a rough glance by noticing that the main steps 1 though 4 have been embedded in the procedure The MbeSendCommand "PLACE CIRCLE ICON" handles drawing the first circle of step 1. The MbeSendCommand "PLACE BLOCK ICON" is used to draw the next outer square in step 2. Then the MbeSendCommand "PLACE CIRCLE ICON" is use to draw the next circle in step 3. Finally, the the MbeSendCommand "PLACE BLOCK ICON" is use o draw the next square in step 4.

'Draws the doubling of the circle, from Serlio, plate 3r, Book On Geometry

Sub main
Dim CenterPoint As MbePoint
Dim point1 As MbePoint, point2 As MbePoint
Dim radius as Double

' Coordinates are in master units
centerPoint.x = 0.0
centerPoint.y = 0.0
centerPoint.z = 0.0
radius = 4.0

' STEP 1: Start Drawing A Circle
' Start a command
MbeSendCommand "PLACE CIRCLE ICON "


' Send center point of circle
MbeSendDataPoint centerPoint, 1%

' Send a data point to the current command
point1.x = centerPoint.x - radius
point1.y = centerPoint.y
point1.z = centerPoint.z
MbeSendDataPoint point1, 1%

' Send a reset to the current command
MbeSendReset

' STEP 2: Draw the next outer Square that circumscribes the Circle
' Start a command
MbeSendCommand "PLACE BLOCK ICON "

' Determine halfsize of next outer square
radius = sqr(radius^2 + radius^2)

' Start Drawing A Square
' Send a data point to the current command
point1.x = centerPoint.x - radius
point1.y = centerPoint.y - radius
point1.z = centerPoint.z
MbeSendDataPoint point1, 1%

point2.x = centerPoint.x + radius
point2.y = centerPoint.y + radius
point2.z = centerPoint.z
MbeSendDataPoint point2, 1%

' Send a reset to the current command
MbeSendReset

' STEP 3: Draw the next outer Circle that circumscribes the Square
MbeSendCommand "PLACE CIRCLE ICON "

' Send center point of circle
MbeSendDataPoint centerPoint, 1%

' Send corner point on circumference
MbeSendDataPoint point1, 1%

' Send a reset to the current command
MbeSendReset

' STEP 4: Draw the next outer Square that circumscribes the Circle
' Start a command
MbeSendCommand "PLACE BLOCK ICON "

' Determine halfsize of next outer square
radius = sqr(radius^2 + radius^2)

' Start Drawing A Square
' Send a data point to the current command
point1.x = centerPoint.x - radius
point1.y = centerPoint.y - radius
point1.z = centerPoint.z
MbeSendDataPoint point1, 1%

point2.x = centerPoint.x + radius
point2.y = centerPoint.y + radius
point2.z = centerPoint.z
MbeSendDataPoint point2, 1%

' Send a reset to the current command
MbeSendReset

End Sub

Looking at this BASIC program in more detail, note that we take advantage of the Pythagorean theorem to calculate the size of each successive square. In particular, we can see how this works if we use Serlio's figures for the doubling circle described at the beginning of this chapter. First look at the distance from the center of small circle K to the corner point a of the smaller square. This distance is equivalent to the corresponding distance from the center of large circle L to any point on its circumference, or in other words the radius of circle L. Now lets assume that we are given the radius of small circle K (radiusK), and we need to determine the radius of large circle L (radiusL). Calculating radiusL will be the key to the success of the procedure.

By inspecting the graphic figure for small circle K, lets assume that a line representing its radius is rotated to12 noon.. Furthermore, assume that it forms one of two legs of a right triangle. Lets also assume that the hypotenuse of this right triangle goes from the center of large circle L to the corner point c. It should now become obvious that the second leg of this triangle is equivalent to the radius of small circle K pointed in the direction of 9 p.m.. We therefore have arrived at a right triangle, where the radius distance of large circle L is equal to the distance of the hypotenuse, and the radius distance of small circle K is equivalent to the the distance of each its legs.. By Pythagorean's theorem we then have that the radius of the large circle L is equal:

radiusL = sqr(radiusK^2 + radiusK^2)

where sqr is a square root function, and ^ is the exponentiation operator.

If instead of bringing this drawing process to a halt at step 4, if we were to continue it indefinitely for any number of steps of odd number n and even number n+1, we might describe it the procedure generally as follows:

Step 1: Draw A Circle At The Point 0.0 ,0.0 ,0.0 with Radius 4.0.
Step 2: Draw the next outer Square that circumscribes the Circle.
Step 3: Draw the next outer Circle that circumscribes the last Square
Step 4: Draw the next outer Square that circumscribes the last Circle.
Step 5: Draw the next outer Circle that circumscribes the last Square
Step 6: Draw the next outer Square that circumscribes the last Circle.
....

Step n: Draw the next outer Circle that circumscribes the last Square
Step n+1: Draw the next outer Square that circumscribes the last Circle.Step 6: End the drawing procedure.

Within the last description we are beginning to recognize a kind of recurring relation. Rather that write down each step explicitly, we choose the shorthand n and n+1. We note that for every step n, we also have a step n+1. We can express this idea in terms of the variable n rather than the more brute for approach of explicitly writing down each step for whatever number of steps is needed. Our analysis of the relationship between the doubling circles and squares has yielded this shorthand. We have also identified that the radius resizing is the key to this recurring pattern of circle and square. Other constructions may yield to other similar kinds of observations, where a series of similar forms can be constructed in a repeated sequence, where each step within the repeated sequence describes a general mathematical relation that is reused.

A doubling of circles of n = 19 steps

The For Loop

Lets now look at concise expression of the procedure for the doubling circles and squares. That is, lets formulate an expression in the BASIC programming language that more precisely expresses the pattern and key that we have discovered. Within the procedure below, we introduce the the BASIC programming technique of a for loop. The integer variable named counter corresponds to our earlier notions of step n and step n+1. Our first time through the loop, the integer variable counter is set to the value of 1, and we draw the first inner circle in step 1 and the circumscribing square in step 2. Our first pass through the loop ends at the statement next step.For our second pass through the loop, the integer variable counter is incremented by 2 steps and is set to the value of three. We now draw a circumscribing circle in step 3 and a circumscribing square in step 4. A third pass of through the loop would mean that counter would be set to the value of 6. This exceeds its predefined limit of 4 in the statement for counter = 1 to 4 step 2. The execution of the loop stops and the program ends.

Note that we also introduce the use of a system function procedure sqr. The function sqr takes an expression within parenthesis and returns a value. The expression within the parenthesis is referred to as the argument to the function. More generally, a function call has the form ... functionname ([argumentlist]), where the argument list is a set of expressions each separated by a comma. The function sqr has single argument. The function sqr returns the square root of the argument. We will see more examples of function calls throughout this chapter, and return more formally to the nature of functions in a later chapter of this text.

Draws the doubling of the circle, from Serlio, plate 3r, Book On Geometry

Sub main
Dim CenterPoint As MbePoint
Dim point1 As MbePoint, point2 As MbePoint
Dim radius As Double
Dim counter As Integer

' Coordinates are in master units
centerPoint.x = 0.0
centerPoint.y = 0.0
centerPoint.z = 0.0
radius = 4.0

for counter = 1 to 4 step 2

' STEP N: Start Drawing A Circle
' Start a command
MbeSendCommand "PLACE CIRCLE ICON "

' Send center point of circle
MbeSendDataPoint centerPoint, 1%

' Send a data point to the current command
point1.x = centerPoint.x - radius
point1.y = centerPoint.y + radius
point1.z = centerPoint.z
MbeSendDataPoint point1, 1%

' Send a reset to the current command
MbeSendReset

' STEP N+1: Draw the next outer Square that circumscribes the Circle
' Start a command
MbeSendCommand "PLACE BLOCK ICON "

' Determine halfsize of next outer square
radius = sqr(radius^2 + radius^2)

' Start Drawing A Square
' Send a data point to the current command
point1.x = centerPoint.x - radius
point1.y = centerPoint.y - radius
point1.z = centerPoint.z
MbeSendDataPoint point1, 1%

point2.x = centerPoint.x + radius
point2.y = centerPoint.y + radius
point2.z = centerPoint.z
MbeSendDataPoint point2, 1%

' Send a reset to the current command
MbeSendReset

Next Counter


End Sub

In general, the for loop contains some integer variable to serve as the counter, the for statement, optionally a step statement, a block of BASIC statements to be executed, and then concludes with and a next statement:

for counter 1 to n [step i]
block of Basic Statements to be executed
Next counter

If we do not include the optional step statement within the for loop, then the counter would by default increment by 1 during each pass through the loop. Note that if our program had excluded the step statement, we would have generated four pairs of circles and squares, since the loop would have been executed four times:

for counter = 1 to 4
...
Next Counter

Without the step statement, the resulting BASIC program would execute the loop four times and produce the following drawing:

Result of removing the step 2 statement from the for loop

Iterative Figures

The series of Golden Rectangles illustrated in Chapter 1 also contains a repeated pattern where the key mathematical relation is to be found in the proportions of a golden rectangle. More generally, we can discover that a number of repeating patterns or relations exist within the graphics descriptions of some forms found in architecture or nature. We might find it more convenient to say that this recurring pattern takes place. while some condition holds, or for a number of steps, or more simply that to reproduce a particular pattern, we need to do a process for a repeated number of times until a certain condition is achieved. Accordingly, the BASIC programming language contains several kinds of iterative control structures to describe a procedure that occurs an indefinite number of times. We have just seen above the use of the for loop in the example above.. We will also review the while ... wend loop and the do ... loop. To some extent each of these iterative control structures can be interchanged. However, the existence of the different kinds of iterative control structures allow some flexibility in the way to describe a repetitive process. In the following sections, we will introduce these iterative control structures with respect to several kinds of curves.

A Circle

Lets imagine that we have a point P that revolves over time in plan about an origin 0. Lets also assume that through every angle of revolution, P remains at a constant distance from 0. Clearly sweeping P through 360 degrees would trace along the shape of a circle. We might approximate this result by determining the rotation of P for some constant angular increment, say every 10 degrees, and then connecting every successive location with a line segment. The lower the angular increment, the smaller the line segment length between locations of point P and therefore the greater the resolution of the circle. The higher the angular increment, the longer the line segment length between locations of point P, and the lower the resolution of the circle. This is demonstrated in the following chart.:

 

high resolution circle:

angular increment = 1

angular increment = 20
angular increment = 30
Low resolution circle:

angular increment = 60

 

The While Wend Loop

The following procedure makecircle uses a while ... wend loop to achieve this result. We introduce the relational operator >= which means greater than or equal to as a means of controlling the execution of the loop. That is, the loop ends when the revolution of P around the origin sweeps greater than or equal to 360 degrees. We shall return to the use of relational operators at the end of this chapter. Note too that we make use of trigonometric functions cos and sin.

' Procedure makecircle to draw a circle as a series of line segments

Sub main
Dim originPoint As MbePoint
Dim point As MbePoint
Dim degr As Single, degrinc As Single
Dim radius As Double, radians As Double
Dim distx As Double, disty As Double


' Coordinates are in master units
originPoint.x = 0.0
originPoint.y = 0.0
originPoint.z = 0.0
radius = 4.0
degr = 0.0
degrinc =20

' Initiate Drawing of Circle while number of degrees less than 360
' Start a command
MbeSendCommand "PLACE LINE"

While degr <= 360.0

' Convert degrees to radians using system constant pi
radians = (pi * degr)/180

' Determine x value and y value of Point
distx = cos (radians) * radius
disty = sin (radians) * radius


' Send a data point to the current command
point.x = originPoint.x + distx
point.y = originPoint.y - disty
point.z = originPoint.z
MbeSendDataPoint point, 1%

' Increment the number of degrees of revolution of the point
degr = degr + degrinc

Wend

' Send a reset to the current command
MbeSendReset



End Sub

The essential mathematics of this program is based on simple trigonometry. To determine the location of P at any angle degr, we first must convert from degrees degr to radians radians. We arrive at the formula for this conversion by recalling the equation 360 degr = 2 pi radians, where pi is equal to approximately 3.14159.... Dividing both sides of this equation by 360 yields the equation 1 degr = pi/180 radians. Therefore, we know that for degr number of degrees , the total number of radians can be expressed as (pi * degr)/180 . Within the program above, this equation is expressed as radians = (pi * degr)/180.

Once we have determined the angle of revolution in radians, we can use the cos and sin functions to determine the x coordinate value and y coordinate value of P.That is, from basic trigonometry we know that distance of the x coordinate of P from the originPoint is equal to the cosine of the radians of P times its distance radius from the originPoint. Within the program makecircle above, this observation is expresses as distx = cos (radians) * radius. Similarly, the distance of the y coordinate of P is equal to sine of the radians of P times its distance radius from the origin.Within the program makecircle above, this observation is expressed as distx = sin (radians) * radius. Finally, the location of point P is equal to the location of the originPoint plus its xdist and ydist values.This observation is expressed as point.x = originPoint.x + distx, and point.y = originPoint.y - disty. Since our circle is 2D, we also have that point.z = originPoint.z.

Also note that we control the resolution of the circle by the value assigned to degrinc. The The higher the value for degrinc, the fewer the points we will use to describe the circle, and therefore, as illustrated earlier, the lower the resolution of the circle. This degrinc has the side effect of converting the circle into a polygon representation. For a six sided polygon, you can use the assign the value of degrinc = 60, and for a four sided polygon, you can assign the value of degrinc=90. Thus, we can see that controlling the drawing of circle through this procedure lends insight into a number of related geometrical shapes.

As observed by D'Arcy Thompson in his great treatise on Growth and Form, we can use a similar logic to look at Archimedes curve and also at the equiangular spiral or logarithmic curve. We can see an Archimedes curve in the shape of a anchor rope that is arranged in a tight spiral on the deck of a ship. As in the case of circle, we again might think of a point P that traces out the shape of this rope as it revolves around an origin point 0. Or, this form might also be found architecturally in the spiral plan for a ziggurat. Thompson noted that the description for logarithmic spiral may be understood in similar terms

"In the elementary mathematics of a spiral, we speak of the point of origin as the pole (O); a straight line having its extremity in the pole, and revolving around it, is called the radius vector; and a point (P) traveling along the radius vector under definite conditions of velocity, will then describe our spiral curve.

Of several mathematical curves who form and development may be so conceived, the two most important (and the only two with which we need deal) are those which are known as (1) the equable spiral, or spiral of Archimedes, and (2) the equiangular spiral or logarithmic curve". [Thompson, On Growth and Form, p. 175].

Archimedes Spiral

A small modification to the program makecircle converts it to a program to make an Archimedes spiral. In particular, we must add a radius increment to exist somewhere in the middle of our while ... wend loop. That is, the radius will lengthen at a constant rate for each degree that the point (P) travels around (O). To achieve this we might create a new variable dim radinc As Double at the beginning of the program. Before entering the main loop, we would initialize the value of radinc as radinc = 1.0. Since within the Archimedes spiral, point (P) may travel around (O) for a number of times, we might want to specify this in terms of a new variable numrev and initialize its value to some desirable number of revolutions, say 5.

' Procedure archimed to draw an Archimedes spiral as a series of line segments


Sub main
Dim originPoint As MbePoint
Dim point As MbePoint
Dim degr As Single, degrinc As Single
Dim radius As Double, radians As Double
Dim distx As Double, disty As Double
Dim radinc As Double, numrev As Double

' Coordinates are in master units
originPoint.x = 0.0
originPoint.y = 0.0
originPoint.z = 0.0
radius = 4.0
degr = 0.0
degrinc = 20
radinc = 1.0
numrev = 5.0

If we want the point (P) to spiral 5 times around the point (O), then we can continue to loop while the number of degrees is less than or equal to 5 revolutions, or 5 * 360. This is achieved with the statement While degr <= (numrev * 360). Within the body of the loop, we add the statement radius = radius + radinc to ensure that spiral increases with each turn of (P) around point (0). These two modifications to the original program makecirle are suggested in the excerpt below.

 

'
While degr <= (numrev * 360)

...
' Increment the number of degrees of revolution and lengthen the radius of the point
degr = degr + degrinc
radius = radius + radinc

Wend

'

These few changes to the original makecircle program will produce the following drawing of an Archimedes spiral.

the spiral of Archimedes at 5 numrev.

The equiangular or Logarithmic Curve

The expanding proportions of a nautilus shell might also be expressed as a loop. In contrast to the Archimedes spiral, the size of the curves increase at a higher rate of change with each increase in revolution angle. Or in other words, as D'Arcy Thompson observed, we still have point (P) traveling about point (O) as in the Archimedes curve. However, within the Archimedes curve, the point (P) moves outward at a uniform velocity along the radius from point (0) as the number of revolutions increase. Whereas, within the logarithmic spiral, the point (P) moves outward at an accelerating rate along the radius from point (0) as the number of revolutions increase.

A very simple adjustment to the program archimed will effect this result. That is, we need to find a way to express the notion that an increase in the radius increments will also occur alongside that of an increase in the radius itself. We can therefore modify the following section of the initial program to add a new variable radaccel which will specify the acceleration rate of the radius.

 

' Procedure radinc to draw a logarithmic spiral as a series of line segments


Sub main
Dim originPoint As MbePoint
Dim point As MbePoint
Dim degr As Single, degrinc As Single
Dim radius As Double, radians As Double
Dim distx As Double, disty As Double
Dim radinc As Double, numrev As Double, radaccel Ad Double

' Coordinates are in master units
originPoint.x = 0.0
originPoint.y = 0.0
originPoint.z = 0.0
radius = 4.0
degr = 0.0
degrinc = 20
radinc = 1.0
radaccel = 2.0
numrev = 5.0

We can now modify the main loop of the procedure such that rate of radius change is also increasing by adding the statement radinc = radinc + radaccel:

'
While degr <= (numrev * 180)

...
' Increment the number of degrees of revolution and lengthen the radius of the point
radinc = radinc + radaccel
degr = degr + degrinc
radius = radius + radinc

Wend

'

For a value of radaccel = 2.0, we obtain the following drawing from running this program.

an increasing equiangular spiral at radaccel = 2 and numrev = 5

As was observed by Descartes, this increasing equiangular spiral has the appearance of a logarithmically expanding curve. The logarithm mathematics of this curve can also be developed from our observations about point (P) rotating about point (O). We first need to revisit the Archimedes curve so as tie more closely together the increasing size of the radius with the angle of (P) around (O)

Revisiting the Archimedes Curve

Yet another mathematical formulation of this Archimedes curve ties more closely together the values for the increasing size of the radius with the angle of (P) around (O). We now might observe with D'Arcy Thompson that each revolution point (P) about point (O) results in a radius = (OP). For an Archimedes curve, we have already noted that the radius is lengthened for each angular turn about point (O). We therefore can say that for some constant value coefa that the radius = degr * coefa, where the value of degr increases with each revolution about point (O) but the value of constant coefa remains the same. We can modify our initial program for the Archimedes curve so as to take this slightly modified observation into account by removing the variable radinc and introducing the variable coefa. The beginning of the program archimed now has the variable radinc removed and the variable coefa added:

 

' Procedure archimed to draw an Archimedes spiral as a series of line segments

Sub main
Dim originPoint As MbePoint
Dim point As MbePoint
Dim degr As Single, degrinc As Single
Dim radius As Double, radians As Double
Dim distx As Double, disty As Double
Dim coefa As Double, numrev As Double


' Coordinates are in master units
originPoint.x = 0.0
originPoint.y = 0.0
originPoint.z = 0.0
radius = 4.0
degr = 0.0
degrinc =10
coefa = 1.0
numrev = 5.0

We can now modify the main loop of the program as follows:

' Increment the number of degrees of revolution and lengthen the radius of the point
degr = degr + degrinc
radius = coefa * degr

Running the Archimedes program modified in this way will give us a similar result as before.

Revisiting the equiangular or Logarithmic curve

Lets re-express the algebra of our procedure so that we use the log function itself to generate a logarithmic spiral. This requires that we use both the mathematics of logarithms and also use some of the properties of exponential numbers. The essential mathematics is applied here without a full treatment of the underlying proofs. Some readers may prefer to trust the underlying mathematics and skip the next three paragraph. D'Arcy Thomson establishes the essential argument of the next two paragraphs in his treatise in On Growth and Form. The derivation is amplified below from the more abbreviated arguments in his original text. The third paragraph contains an additional transformation that allows us to more directly develop a corresponding computer graphics procedure.

We first need to delve a little into the definition of logarithms. In algebra we say that y is equal to the log of x base z if z^y gives us x. A constant number referred to as base e has special properties. The value of e is 2.71828183 when carried out to 8 decimal places. We can say that y is equal to the natural log of x if e^y gives us x. Or, it can be stated more simply that y is the log of x if e^y gives us x.

Within the Archimedes spiral, we have seen in the example above that radius = degr * coefa . However, in the equiangular or logarithmic curve, we noted before that the radius increases exponentially. Therefore, the statement radius = coefa * degr needs to be adjusted. We can test the proposition that for any point (P) along the curve we would find that radius = coefa ^ degr for some constant coefa. That is, the radius of the point (P) is equal to some constant coefa taken to the exponent of degr. Taking the log of each side of the last expression we get log (radius) = log (coefa^degr). However, we know that logarithms have the property that log (coefa^degr) = degr * log (coefa). Taking the last two equations, we replace the right hand side of the first one with the right hand side of the second one and get that log (radius) = degr * log (coefa). Dividing both sides of this last equation by log (coefa), we now get degr = log (radius) / log (coefa). However, since coefa is a constant, then so is log (coefa). Lets define constanta as 1/log(coefa), and we can go further and reduce our equation to degr = log (radius) * constanta. This last equation gives meaning to Descartes particular observation that the angles of a point (P) revolving about point (O) are proportional to the logarithm of the radius. D'Arcy Thompson states that you can also understand the point (P) to accelerate as it moves outward from (O) in that it covers an increasing distance with each degree of turn.

Note in the animation below (for those viewing this page on the World Wide Web) how this acceleration may be evident in the movement of (P) along the edge of a nautilus shell. Imagine that (O) is at the center of the nautilus shell. The last few turns cover more distance per each change in angle. Therefore, the length of the curve grows more rapidly in the final frames of the animation.

+

animation showing acceleration of point (P) around (O)
tracing out the curve of a nautilus shell

It is convenient in developing a procedure to be able to control our loop for some number of degrees. Therefore, we can take the last equation of the preceding paragraph degr = log (radius) * constanta, and transpose it so that the radius may be found from the number of degrees. That is, lets multiply both sides by 1/newconsta so that the equation becomes degr/constanta = log (radius). If we refer to the definition of log (radius), then the last equation becomes radius = e^(degr/constanta). That is, we now have an equation in which the length of the radius can be determined on the basis of the degrees of revolution of point (P) about (O). We also have shown in the preceding paragraph how the log function is used in establishing this equation.

The Do Loop

Using our new found equation radius = e^(degr/constanta), lets now at last rewrite the procedure for a generating an equiangular or logarithmic curve. We will assign a value of 344.0 for constanta such that the size of the logarithmic curve matches the growth of a specific Nautilus shell (author's discovery). We will also use the third iteration technique of a do ... loop until. This is the third kind of iteration technique that we will review in this chapter. The do ... loop until structure will repeat a block of code until reaching a condition. In this case, we want the looping to stop when we have exceeded revolving the point (P) around (0) for a number of degrees greater than (numrev * 360). This condition is satisfied when degr > (numrev * 360) as indicated in the procedure below.

' Procedure logspir to draw a logarithmic spiral as a series of arcs

Sub main
Dim originPoint As MbePoint
Dim point As MbePoint
Dim degr As Single, degrinc As Single
Dim radius As Double, radians As Double
Dim distx As Double, disty As Double
Dim constanta As Double, numrev As Double
Dim constante As Double

' Coordinates are in master units


originPoint.x = 0.0
originPoint.y = 0.0
originPoint.z = 0.0
numrev = 6.5
degr = 0.0
degrinc =10
constanta = 344.0 'Some value that works for a Nautilus shell.
constante =2.7182818


' Initiate Drawing of Spiral As a Series of Arcs
' Start a command
MbeSendCommand "PLACE CURVE ICON "

Do

' note that (1) degrees = log(radius) * constanta,
' which means that (2) degrees/constanta = log(radius),
' which in turn yields:

radius = constante^(degr/constanta)


' Convert degrees to radians using system constant pi
radians = (pi * degr)/180.0

' Determine x value and y value of Point
distx = cos (radians) * radius
disty = sin (radians) * radius


' Send a data point to the current command
point.x = originPoint.x + distx
point.y = originPoint.y + disty
point.z = originPoint.z
MbeSendDataPoint point, 1%

' Increment the number of degrees of revolution and lengthen the radius of the point
degr = degr + degrinc

Loop until degr > (numrev * 360.0)

' Send a reset to the current command
MbeSendReset

End Sub

Running this new program within the CAD system for a constanta value of 344 traces out the growth of the nautilus shell.

The Logarithmic Curve of a Nautilus Shell for constanta value of 344.0

Relational Operators

Throughout this chapter we have use three kinds of iterative structures, the for loop, the while wend loop, and the do loop. Each kind of loop concludes when a particular condition is reached. Futhermore, some test is typically applied every time a loop is executed to see if the terminating condition has occurred. Often, terminating conditions are expressed with the use of a relational operator. The relational operator is used to compare two expressions . It produces a valued of True (-1) or False (0). This value typically has use in the context of a loop. A result of True (-1) will typically provide that the loop be repeated an additional cycle and a result of False (0) would provide that the loop be discontinued. We have seen examples of this usage in the programs above. In the most recent example for the logarithmic curve, the relational operator was embedded within the statement Loop until degr > (numrev * 360.0). This means continue the loop until the value of the following expression is True (-1). If the variable numrev had been assigned the value of 2.0, then the loop would stop as soon as the value of the variable degre becomes greater than (2 * 360.0). That is, when as the value of the variable degr becomes greater than 720.00, then the expression degr > (numrev * 360.0) evaluates to be True (-1), and that caused the termination of the loop.

We will be using relational operators routinely in the control of loops and within other contexts. The following table lists the main kinds of relational operators available in the BASIC programming language.

Relational Operator Purpose Number Arguments Example Result
= is the left hand expressions equal to the right hand expression 2 3.0 = (9.0 - 6.0) -1
>= is the left hand expression greater than or equal to the right hand expression 2 3.0 = (9.0 - 6.0) -1
> is the left hand expression greater than the right hand expression 2 3.0 = (9.0 - 6.0) 0
<= is the left hand expression less than or equal to right hand expression 2 3.0 = (9.0 - 6.0) -1
< is the left hand expression less than the right hand expression 2 3.0 = (9.0 - 6.0) 3.0
<> is the left hand expression not equal to the right hand expression 2 3.0 = (9.0 - 6.0) 1

Loops may also be controlled by other kinds of operators. Logical Operators are also used often. We will return to the discussion of logical operators, however, in a later chapter of the text.

Summary

Within this chapter we have examined the nature of certain geometrical compositions where recurring relationships among more primitive parts are in evidence. The discovery of these recurring relationships allows us to think of these geometrical compositions from a perspective that takes into account broader patterns and not just individual elements. The BASIC programming language provides for an analogous means to articulate the recurring relations as a procedure. In particular, we have examined the use of loops to describe Serlio's doubling circles, an Archimedes curve, and have re-visited D'Arcy Thompson's logarithmic spiral applied to a nautilus shell. We have seen three kinds of loops structures provided within the BASIC language (1) for ... next, (2) while ... wend, and (3) do ... until loop. These structures are for the most part interchangeable,. However, one kind of structure may may be at times provide for a more useful expression of the circumstances related to a particular loop.

Within the next chapter, we will begin to look at other ways of structuring a graphics composition. Whereas in this chapter we looked at recurring relations within graphic compositions, in the next chapter we will look at the higher level organization of different kinds of recurring relations that may also be evident within graphic compositions.

Assignment 4: Procedures that express recurring relations