# The Spiral

I'm trying to place circles along the outside of an Archimedean spiral. Shown below:

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


# The Circles

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:

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

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).

# 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.

-
is this in anyway related to this? ;o) – Öskå Jan 22 '14 at 11:32
Could you provide the whole code generating the "end product" please? :) – Öskå Jan 22 '14 at 11:52
@Öskå Yes, that is precisely what it is related to. The code is quite boring with the exception of the code that KennyColnago helped me with. I just generated a table where each part was {Color,Disk} counting up to 1000, and pulling a number off the value of Pi. – MRN16 Jan 23 '14 at 2:07
I also tried to do it as well but failed beautifully.., maybe you can paste it to pastebin? – Öskå Jan 23 '14 at 3:07
pastebin.com/qDsMe3J8 – MRN16 Jan 23 '14 at 3:30

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

Graphics[Map[{ColorData["DarkRainbow",Mod[#,Pi]/5 + Norm[CircleCentres[#]]^1.7/190],

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