4
MATHEMATICAL RECREATIONS Around and Around If a curve C 1 rolls without slip- ping along another curve c2. any fixed point on C 1 traces a path called a roulette. One of the simplest of these is the cy- cloid, formed when C 1 is a cir- cle and c2 is a straight line. For every rotation of the circle, a cycloidal arch is formed, as hown in figure Ia. Galileo is credited with naming this curve. He conjectured that the area under one arch is euctly three times the area of the generating circle. In the early 1630s, Gilles Personne de Roberval proved this to be true. Another interesting property is that the length of one cycloidal arch is euctly four times the diameter of the generating circle; that is, the length of one arch equals the perimeter of the square cir- cumscribed about the circle. For a thor- ough treatment of the cycloid, I recom- mend Martin Gardner' excellent Sixth Book of Mathenllltical Gatrn!s from Sci- entific American (W. H. Freeman & Co., 1963). We can expand the realm of cycloids by moving the point off the circle's circum- ference. If the point is fixed inside the cir- cle, we get a curtate cycloid; an exterior fixed point re ults in a prolate cycloid (see figures lb and lc). Rolling a circle inside another circle rather than along a straight line produce a hypocycloid. The number of points, or cusps, is determined by the ratio of two circles' radii. A fixed-circle radiu that is four times the rolling-circle radius pro- duces an astroid, that is, a hypocycloid of four cusps (see figure ld). As was the case before, moving the point away from the rolling circle's circumference pro- duce prolate and curtate version of the hypocycloid. Now consider a circle rolling around the outside of the fixed circle. The fixed point traces an epicycloid in this case. When both circles have the same radiu , the curve is the familiar cardioid-a cy- cloid that has been bent around another circle (see figure le). Curtate and prolate Robert T. Kurosaka Exploring the family of curves known as cycloids using computer graphics varieties apply here, as well. The upside-down, or inverted, cycloid has remarlcable properties. Consider two points A and B on a ramp, with A to the side of and slightly above B (see figure 2). A marble released at point A will travel to point B by the force of gravity. The shape of the path between tho e points determines how long the marble takes to reach B. If you construct ramp of varying shapes and conduct marble race from A to B, you will find that a cy- cloidal ramp gives the shortest time. This is true even if the marble has to go uphill part of the way to reach B. The inverted cycloid is thus known as a curve of quick- est descent, a brachistochrone. Johann Bernoulli • s proof of this property is found in What Is Mathematics? by Richard Courant and Herbert Robbins (Oxford University Press, 1941). The inverted cycloid is also a curve of equal descent, an isochrone or tauto- chrone. A marble will always take the same amount of time to reach the bottom of a cycloidal ramp, regardless of its start- ingpoint. The Dutch physicist Christian Huy- gens discovered this property in 1673, which led him to study the possibility of developing a perfect pendulum clock. If a pendulum could swing in a cycloidal rather than a circular arc, its period would be constant regardle s of the am- plitude of the swing. Huygens attempted such a design, u ing a flexible pendulum arm (string) and a pair of cycloidal "bumpers" flanking the pivot. However, the resulting friction made the clock even more inaccurate than the circular-arc pendulum, so it had to be abandoned. What about the error of a circular arc? For relatively small amplitudes, the cir- cular arc is sufficiently accurate, due to the approximation sin 9 9 for small9, measured in radians. Programming Cydoids Before the advent of affordable computer graphics, we could only read about these mathe- matical curves and admire them. Now, with a little programming, we can create curve of our own and experiment with them endlessly. The programs in this article are all written for an IBM PC with BASIC or GW BASIC. A graphics adapter is also required. However, if your computer has some other version of BASIC with simi- lar graphics capabilities, you shouldn't have much trouble modifying the graph- ics commands. The remarks in the list- ings will help in the translation. The program in listing 1 graphs two complete arches of a cycloid. You specify the location of the fixed point, or pen (as it is referred to in the program), with re- spect to a circle of radius 1. For eumple, a pen location of 1.2 places the pen 1.2 units away from the rolling circle's cen- ter. However, when the curve is drawn on the screen, these distances are scaled up as large as possible without exceeding the screen size. The programs in listings 2 and 3 let you explore hypocycloids and epicycloids, re- spectively. In addition to setting the pen location, you specify the ratio of the fixed circle to the rolling circle. A value of 1 makes the two circles equal; a value less than 1 makes the fixed circle smaller than the rolling circle; and a value greater than 1 malces the fixed circle larger than the rolling circle. Note that ratios larger than 1 need not be integral. For instance, a ratio of3.5 is allowed; it produces a curve that closes Robert T. Kurosalca teaches malhtnllltics in the Massachusetts State College sys- tem. He can be reached c/o BYTE, One Phoenix Mill l.aM, Peterborough, NH 03458. MAY 1987 • 8 Y T E 307

Around and Around - Alyoops! value of 1 makes the two circles equal; ... 140 PI•3.141~92SI 150 • 160 'Get paro•etere 170 SCREEN 0,1: WIDTH 80: CLS 180 PRINT "Draw o cycloid"

Embed Size (px)

Citation preview

MATHEMATICAL RECREATIONS

Around and Around

If a curve C1 rolls without slip­ping along another curve c2. any fixed point on C1 traces a path called a roulette. One of the simplest of these is the cy­cloid, formed when C1 is a cir­cle and c2 is a straight line. For every rotation of the circle, a cycloidal arch is formed, as hown in figure Ia.

Galileo is credited with naming this curve. He conjectured that the area under one arch is euctly three times the area of the generating circle. In the early 1630s, Gilles Personne de Roberval proved this to be true.

Another interesting property is that the length of one cycloidal arch is euctly four times the diameter of the generating circle; that is, the length of one arch equals the perimeter of the square cir­cumscribed about the circle. For a thor­ough treatment of the cycloid, I recom­mend Martin Gardner' excellent Sixth Book of Mathenllltical Gatrn!s from Sci­entific American (W. H. Freeman & Co., 1963).

We can expand the realm of cycloids by moving the point off the circle's circum­ference. If the point is fixed inside the cir­cle, we get a curtate cycloid; an exterior fixed point re ults in a prolate cycloid (see figures lb and lc).

Rolling a circle inside another circle rather than along a straight line produce a hypocycloid. The number of points, or cusps, is determined by the ratio of two circles' radii. A fixed-circle radiu that is four times the rolling-circle radius pro­duces an astroid, that is, a hypocycloid of four cusps (see figure ld). As was the case before, moving the point away from the rolling circle's circumference pro­duce prolate and curtate version of the hypocycloid.

Now consider a circle rolling around the outside of the fixed circle. The fixed point traces an epicycloid in this case. When both circles have the same radiu , the curve is the familiar cardioid-a cy­cloid that has been bent around another circle (see figure le). Curtate and prolate

Robert T. Kurosaka

Exploring the family of curves known as cycloids using computer graphics

varieties apply here, as well. The upside-down, or inverted, cycloid

has remarlcable properties. Consider two points A and B on a ramp, with A to the side of and slightly above B (see figure 2). A marble released at point A will travel to point B by the force of gravity. The shape of the path between tho e points determines how long the marble takes to reach B. If you construct ramp of varying shapes and conduct marble race from A to B, you will find that a cy­cloidal ramp gives the shortest time. This is true even if the marble has to go uphill part of the way to reach B. The inverted cycloid is thus known as a curve of quick­est descent, a brachistochrone. Johann Bernoulli • s proof of this property is found in What Is Mathematics? by Richard Courant and Herbert Robbins (Oxford University Press, 1941).

The inverted cycloid is also a curve of equal descent, an isochrone or tauto­chrone. A marble will always take the same amount of time to reach the bottom of a cycloidal ramp, regardless of its start­ingpoint.

The Dutch physicist Christian Huy­gens discovered this property in 1673, which led him to study the possibility of developing a perfect pendulum clock. If a pendulum could swing in a cycloidal rather than a circular arc, its period would be constant regardle s of the am­plitude of the swing. Huygens attempted such a design, u ing a flexible pendulum arm (string) and a pair of cycloidal "bumpers" flanking the pivot. However, the resulting friction made the clock even more inaccurate than the circular-arc pendulum, so it had to be abandoned.

What about the error of a circular arc? For relatively small amplitudes, the cir­cular arc is sufficiently accurate, due to

the approximation sin 9 • 9 for small9, measured in radians.

Programming Cydoids Before the advent of affordable computer graphics, we could only read about these mathe-

matical curves and admire them. Now, with a little programming, we can create curve of our own and experiment with them endlessly.

The programs in this article are all written for an IBM PC with BASIC or GW BASIC. A graphics adapter is also required. However, if your computer has some other version of BASIC with simi­lar graphics capabilities, you shouldn't have much trouble modifying the graph­ics commands. The remarks in the list­ings will help in the translation.

The program in listing 1 graphs two complete arches of a cycloid. You specify the location of the fixed point, or pen (as it is referred to in the program), with re­spect to a circle of radius 1. For eumple, a pen location of 1.2 places the pen 1.2 units away from the rolling circle's cen­ter. However, when the curve is drawn on the screen, these distances are scaled up as large as possible without exceeding the screen size.

The programs in listings 2 and 3 let you explore hypocycloids and epicycloids, re­spectively. In addition to setting the pen location, you specify the ratio of the fixed circle to the rolling circle. A value of 1 makes the two circles equal; a value less than 1 makes the fixed circle smaller than the rolling circle; and a value greater than 1 malces the fixed circle larger than the rolling circle.

Note that ratios larger than 1 need not be integral. For instance, a ratio of3.5 is allowed; it produces a curve that closes

cortli~d

Robert T. Kurosalca teaches malhtnllltics in the Massachusetts State College sys­tem. He can be reached c/o BYTE, One Phoenix Mill l.aM, Peterborough, NH 03458.

MAY 1987 • 8 Y T E 307

MATHEMATICAL RECREATIONS

(a) (b)

crrrn (c)

(e)

Flgure 1: A mri~ty of curves produud by rolling a circl~ along anoth~r curve: (a) simpl~ cycloid; (b) curtat~ cycloid; (c) pro/at~ cycloid; (d) hypocycloid of four cusps, or astroid; (~) ~pi cycloid of on~ cusp, or cardioid.

(begins repeating) only after two revolu­tions and seven cusps. In general, if the decimal ratio is restated as a quotient min

in lowest terms, the rolling circle will make n revolutions and produce m cusps. In theory, an irrational number produces

A

Flgure 2: An inven~d cycloid defin~s th~ path of quicust d~sc~nt and t~ path of ~qUIJl tksc~nt.

a curve that never closes. However, be­cause my computer says that SQR(2) is 1.4142356, I anticipate a curve that closes after some 25 million revolutions with more than 35 million cusps.

In all three listings, the program plots 100 points per revolution. You can in­crease the number of points for a better­looking curve, but this will slow down the drawing process proportionately.

Any standard calculus text should pro­vide derivations of the equations used in these programs.

Beyond Cycloids Kenner Industries makes a design toy called Spirograph. The set includes a col-

continu~d

Customizable power for every business function with a one-year, failsafe, nationwide warran!i Our PC TECH MPC-286-6/10 MHZ SYSTEM. A multi·tasking/ multi-purpose computer system for single users or a multi-user network. Configurations for B. 16, 24. or 32 users. Pllen11m1· n•lllngle-uur price: only $1741. Non·Xenlx Nrsllln (DOS

OUR PORTABLE PC TECH P/286 TARGA has 4 graphic modes on the motherboard and a 1.2MB (or 360K) ffoppy. Fits under an airplane seat, and is 3396 faster than the comparable Compaq 286 /1. DDT fa6W6y prlc.: Dilly $2415.

THE PC TECH X-TURBO runs on a 8088·2 CPU and is fully IBM XT compatible. Has 640K RAM and a 360K floppy. Only $115 wltlt • monllfnphk c•rtJ•nd PGS MAX·12 monltllr.

3·2) only $UI5. 12 MHZ IIPtlllll rP,-ri-Ce_t_'h_e -CO_m_p_a_ra_tJl-BS-Bn_d_ca_l/_fo_r_de_fa_j_fe-d-Sp_ecs___, WifTlflty=bll. (408) 435·9550 ~TECH

't"• "o ._, 'I•• "I ""' {I

=or~-USA Dr visit our hands-on, full-display showrooms 712 (Jwr;(]( Nlnut. 5MJ Josl, CA 95131

308 B Y T E • MAY 1987 Inquiry 243

' . EMPLOYMENT OPPORTUNITIES

Computer Sc1ent1sts, Mathematicians. Systems Analysts - Positions In sclentllic computer software development, systems analysis and fl ight test data analysis. $32,567 to $42,341 depending c.n qualifications with opportunity for advancement. Knowledge of real-time systems, CDC computers, Gould MPX and Unix operating systems, Fortran lan­guage and Ingress DBMS are a plus. ThrH years minimum experience required. Positions located at the Flight Test Center, Edwards Air Force Base. California. U.S. citi­zenship necessary. Send resume to D.S. Painter - 65t0 ABG/ OPCA, Edwards AFB, CA 93523 or ca111 -800-221-2343 ext 2876 (In­side California) or 1-800-545-0431 ext 2876 (outside California) for more Information.

EMPLOYMENT OPPORTUNITIES

Section BYTE will feature a special section for recruitment advertising in future issues.

BYTE is the perfect place to look for those High Technology professionals you need-over 300,000 paid domestic subscribers.

Or, if you're looking for a new position, this is the place to feature a Position Wanted ad.

The cost for any display ad in this new EMPLOYMENT OPPORTUNITIES section is only $352.00 per inch. For quotes on all other size ads, or any additional information call our recruitment telephone sales staff at

212/512-2556

Or send in your order to:

BYTE Recruitment Advertising Center P.O. Box900 New York, NY 10020

310 B Y T E • MAY 1987

MATHEMATICAL RECREATIONS

Listing 1: The BASIC program to graph cycloids.

1ee KEY OFF 'Turn off key label• • 110 DEF FNMAX(A,B)•-(A>B)•A-(B>•A)•B 'Maxl•u• of A and B

120 WD-319 'Width of ecreen 138 HT•199 'Height of ecreen 140 PI•3.141~92SI 150 • 160 'Get paro•etere 170 SCREEN 0,1: WIDTH 80: CLS 180 PRINT "Draw o cycloid" 190 PRINT "Enter the pen poeltlon w.r.t. o circle of

rodlue 1." 200 PRINT "<1 11 lnelde, •1 le on circle, >1 11 outelde" 210 INPUT "Pen poeltlon (-1 to quit)"; H 220 IF H<0 THEN END 230 • 240 'Dietlnguleh between curtote and prolate cycloid• 250 IF H<•1 THEN TN-1: TH-e: GOTO 298 'Cur tote 260 TN-SQR(H•H-1): TH-ATN(TN) 'Prolate 270 • 280 'Scale the unite 290 A•WD/(4•PI+2•TN-2•TH) 'Rodlue of circle 3ee H-H•A 'Dietonce of pen fro• circle'• center 310 X0•A•TN-A•TH: YB-HT-FNWAX(A,H) 'X- and Y-orlgln ,20 • 330 'Set up the ecreen 340 SCREEN 1,1 '320 x 200 grophlce 350 LINE(X0,0)-(X0,HT),2 'X-oxle In color 2 360 LINE (0,Y0}-(WD,Y0),2 'Y-oxle In color 2 370 CIRCLE(X0,Y0-A),A,3 'Circle ot origin (color 3) 380 CIRCLE{X0+2•PI•A,Y0-A),A,3 'Circle ot 1 rev. 390 CIRCLE (X0+4•PI•A,Y0-A),A,3 'Circle ot 2 rev. 400 PSET(X0,Y0-A},3 'Mark center of each circle 410 PSET(X0+2•PI•A,Y0-A),3 420 PSET (X0+4•PI•A,Y0-A),3 430 • 440 'Graph the cycloid 450 FOR ANG•0 TO 4•PI STEP 2•PI/18e '100 pointe/ore 460 X•X0+A•ANG-H•SIN{ANG) 470 Y•Y0-A+H•COS(ANG) 480 IF Y<0 OR Y>HT THEN ~00 498 PSET {X,Y),1 5ee NEXT ANG 510 • ~20 IF INKEY$-"" THEN ~20 'Hold until o key le preeeed. ~30 GOTO 170

Llstina l: The BASIC program to graph hypocycloids.

100 KEY OFF 110 W0•319: HT•199 120 XB-WD/2: YB-HT/2 130 PI•3.141592SI 140 • 150 'Get poro•etere 180 SCREEN 0,1: WIDTH 80: CLS 170 PRINT "Draw o hypocycloid" 180 INPUT "Ratto of fixed to rolling circle ( >- 1 )"; R 198 IF R<1 THEN END 2ee PRINT "Enter pen poeltlon w.r.t. o circle of rodlue

1." 210 PRINT "<1 11 lnelde, •1 I• on circle, >1 le outelde" 220 INPUT "Pen poeltlon (-1 to quit)"; H 230 IF H<0 THEN END 240 IF H<•1 THEN A•.~•HT: GOTO 288 250 A•.~•R•HT/(R+H-1)

c0n1inued • 111M b. rtgisk

ftOfAY.M AJ i~•

lnquiry41

ll"tUII1 loll

ENCLOSURES • POWERSUPPUES

tor FLOPPY WINCHESTER TAPE DRIVES

from $100

for SINGLE BOARD COMPUTERS

from $125

for IBM. 5-100 SYSTEMS from $200

'1 poKe, pnc .. ~owr In quonllly. (01111 dllwM not InCluded)

Coli or write for free catalog

8620 Roolell8lt Ave. • Vlsala, CA 93291 209/651·1203

TELEX 5106012830 (INTEGRAND UD) ........................ ....._

3U 8 Y T E • MAY 1987

. -·-- ~ -

..

MATHEMATICAL RECREATIONS

280 B•A/R 270 H-H•B 280 ' 290 'Set up ecreen 300 SCREEN 1,1: CLS '320 x 200 graphlce 310 LINE(X0,0)-(X0,HT),2 'X-acale, color 2 320 LINE(8,Y8)-(WD,Y8),2 'Y-acale, color 3 338 CIRCLE(X8,Y8),A,3 'Fixed circle, color 3 348 CIRCLE(X8+A-B,Y8),8,3 'Rolling circle, Initial poe. 358 ' 368 'Hypocycloid 378 ANG•8 'Initial value 388 ANG•ANG+2•Pif100 '100 pointe per rev . 398 X•X8+(A-B)•COS(ANG)+H•COS(ANG•(A-B)/B) 488 Y•Y&-(A-B)•SIN(ANG)+H•SIN(ANC•(A-B)/8) 418 PSET(X,Y) 428 • 438 'Keep drawing until a key Ia preaaed. 448 IF INKEY$<>"" THEN 168 ELSE 388

Listing 3: The BASIC program to graph epicycloids.

188 KEY OFF 118 WD-319: HT•199 128 X8•WD/2: Y&-HT/2 138 Pl•3.1415928f 148 SCREEN 8,1: WIDTH 88: CLS 158 ' 168 print "Draw an eplcyclold" 178 INPUT •Ratio of fixed to rolling circle ( &-quit)•; R 188 IF R•8 THEN END 190 PRINT "Enter pen poaltlon w.r.t. a circle of radlua

1." 208 PRINT "<1 Ia lnalde, •1 Ia on circle, >1 Ia outalde• 218 INPUT "Pen poaltlon (<•0 to quit)"; H 228 IF H<•0 THEN END 238 A• .5•R•HT/(R+H+1) 240 B-A/R 250 H-H•B 268 • 270 'Set up acreen 288 SCREEN 1,1: CLS '328 x 288 graphlca 290 LINE(X0,0)-(X0,HT),2 'X-acale, color 2 300 LINE(8,Y0)-(WD,Y0),2 'Y-acale, color 3 318 CIRCLE(X8,Y0),A,3 'Fixed circle, color 3 320 CIRCLE(X8+A+B.Y0),8,3 'Rolling circle, initial poe. 338 • 340 'Hypocycloid 350 ANG-0 'Initial value 360 ANC•ANC+2•PI/100 '100 pointe per rev. 370 X•X0+(A+B)•COS(ANC)-H•COS(ANC•(A+B)/B) 380 Y•Y8-(A+B)•SIN(ANC)+H•SIN(ANC•(A+B)/B) 390 PSET(X, Y), 1 488 • 418 'Keep drawing until a key Ia preaaed. 428 IF INKEY$<>"" THEN 140 ELSE 388

lection of large tracks and smaller wheels that rotate inside the tracks. When a pen is attached to the wheel , it draws an inter­esting pattern. A cycloid, right? Not al­ways, because some of the tracks and wheels are ovals, rounded triangles, and odd shapes.

It hould be possible to use a computer to simulate these beautiful roulettes on a

computer, as long as the track and the wheel can be specified mathematically. I encourage you to explore this problem, but beware: The math required is consid­erably more advanced than what we've used in this article. (If truth be known, the author hasn't programmed this one yet.)

Your comments are welcome. •

Stati data i unsee small myste

Andst across upast enougl