8

The Spiral

I'm trying to place circles along the outside of an Archimedean spiral. Shown below: Archimedian Spiral from 0 to 6 Pi

ParametricPlot[{θ/(2*π)*Cos[θ], θ/(2*π)*Sin[θ]}, {θ, 0, 6π}, PlotStyle -> Red]

The Circles

Circle placement

To do this effectively I have been trying to use the Law of Cosines to determine the change in the angle. I found the path that would contain the circle centers:

f[θ_] := {((π+θ) Cos[θ])/(2π), ((π+θ) Sin[θ])/(2π)}

Using the Law of Cosines for the following:

Law of Cosines for this example

Seems pretty straight forward, right? Well, when I went to solve for the angle alpha Mathematica seems to have trouble.

code

seems to work "fine", but any subsequent evaluations don't seem to go smoothly. In fact, any evaluation that does not contain Pi seems to fail, and an evaluation of the distance between the points shows that the angle is off (!=1).

Distance

The Question

What am I doing wrong to be more than 5% off from what I expect. Also, is there a more efficient and correct method to solve for the angle?

An End Product

Thanks to KennyColnago for his response. Final Product

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
MRN16
  • 601
  • 5
  • 9

1 Answers1

3

The expression I get for the angle angle increment $d$ is

(d^2 + 2d (Pi + t) + 2(Pi + t)^2 - 2(Pi + t)(d + Pi + t) Cos[d])/(4 Pi^2) = c^2

For your problem, $c=1$ and $t$ is the start angle of Pi/2. Solve the transcendental equation for d using

FindRoot[(d^2 + 2d (Pi + t) + 2(Pi + t)^2 - 2(Pi + t)(d + Pi + t) Cos[d])/(4 Pi^2) == 1
         /. {t->Pi/2}, {d,1.0}]

The answer is d=1.241radians. The second circle centre on your blue line is therefore atf[Pi/2+1.241]={-0.896,0.307}. The next angle increment isd=1.0054, found by solving witht->Pi/2+1.241.

However, you seem to be assuming that circles of radius 1/2 with centres on the blue curve are tangent to the red spiral. Not so. The circles touch the spiral function along a radial line from the origin, but they are not tangent to, or bounded by, the spiral.

Edit

I like your design! How about less random colourings, as in

Graphics[Map[{ColorData["DarkRainbow",Mod[#,Pi]/5 + Norm[CircleCentres[#]]^1.7/190], 
              Disk[CircleCentres[#],0.5]}&, NestList[NextAngle[#]&, Pi/2, 800]]]

whereCircleCentres[angle]is yourf[theta], andNextAngledoes aNestListof theFindRootresult.

KennyColnago
  • 15,209
  • 26
  • 62
  • The placement on the outside of the spiral is approximate, but becomes quite good after the first few turns. Towards the center the approximation does break down though, I'm avoiding a lot of problems by starting at Pi/2, but I understand that the average distance between the one loop and the +2Pi loop does not equate to being tangential or, by necessity, bounded by the spiral. – MRN16 Jan 20 '14 at 03:21
  • It works though and far more efficiently than I was expecting from what I was working with earlier. – MRN16 Jan 20 '14 at 03:38