3

I have an Archimedean spiral determined by the parametric equations x = r t * cos(t) and y = r t * sin(t).

I need to place n points equidistantly along the spiral. The exact definition of equidistant doesn't matter too much - it only has to be approximate.

Using just r, t and n as parameters, how can I calculate the coordinates of each equidistant point?

snazzybouche
  • 2,241
  • 3
  • 21
  • 51
  • what do you mean by equidistantly? equal distance along the spiral, or in the `xy` plane? And what range of the spiral do you want to split? Since `t` is not defined, it could be infinite. And you can't deal with `infinity` in a finite context. Please rewise and update your question. – Thomas Jun 24 '17 at 21:26
  • All variables will be defined by the programme. I'm looking for a general solution. I feel like "n equidistant points around a spiral" should be fairly self explanatory – snazzybouche Jun 24 '17 at 21:55
  • 1
    Then how about `for(var i=0; i – Thomas Jun 24 '17 at 22:06
  • 1
    I'm not an expert but I'm fairly sure a curve with `y = 0` isn't a spiral – snazzybouche Jun 24 '17 at 23:00

1 Answers1

6

You want to place points equidistantly corresponding to arc length. Arc length for Archimedean spiral (formula 4) is rather complex

s(t) = a/2 * (t * Sqrt(1 + t*t) + ln(t + Sqrt(1+t*t)))

and for exact positions one could use numerical methods, calculating t values for equidistant s1, s2, s3... arithmetical progression. It is possible though.

First approximation possible - calculate s(t) values for some sequence of t, then get intervals for needed s values and apply linear interpolation.

Second way - use Clackson scroll formula approximation, this approach looks very simple (perhaps inexact for small t values)

 t = 2 * Pi * Sqrt(2 * s / a)

Checked: quite reliable result

enter image description here

MBo
  • 77,366
  • 5
  • 53
  • 86
  • Looks good to me, I'll give this a test and report back. Cheers! – snazzybouche Jun 25 '17 at 05:27
  • In your formulas, is your `a` the same as my `r`? – snazzybouche Jun 25 '17 at 05:27
  • Yes, it is the same, scale coefficient – MBo Jun 25 '17 at 08:00
  • Trying to work through the linked document - it seems like `s` still contains `θ`? If so, then surely the formula will not work (as my `t` is the document's `θ`); if not so, then what is `s`? Thank you! – snazzybouche Jun 25 '17 at 16:49
  • My mistake, the two formulas grouped together are rearrangements of each other – snazzybouche Jun 25 '17 at 16:50
  • Hiya all! how would this apply to an archimedes spiral? for example r=10(t/π)? what are `s` and `a`? (clackson approximation) – sharkyenergy Feb 07 '21 at 13:15
  • @sharkyenergy `a` is coefficient before angle. In your case `a=10/π`. `s` is arc length – MBo Feb 07 '21 at 14:16
  • @MBo, thank you very much! so if I get it right: t = 2 * Pi * Sqrt(2 * s / a) ---> if I put in 10/π for a, and 110 for s for example, I get t, wich is the radius I have if I stop 110 along the spiral starting from the centre? – sharkyenergy Feb 07 '21 at 15:32
  • @MBo, thank you but I still not sure I get the full picture... My spiral r=10(t/Pi) after one whole rotation is at 2PI, and a distance of 20. the spiral length is about 62. so If I put 62 in as s, I should get t=2PI, right? instead I get 39.2.. what am I missing? – sharkyenergy Feb 07 '21 at 16:28
  • 1
    @sharkyenergy OK, too old theme ;) I tangled different definitions. For spiral defintion `r=a*t/(2Pi)`, and `a=20` in your case, `s=a*t^2/(4Pi), t=2*sqrt(Pi*s/a), r=sqrt(s*a/Pi)` – MBo Feb 07 '21 at 17:13
  • @MBo YAYYYYYY thank you very much! you have no idea how important this was for me.. :) – sharkyenergy Feb 07 '21 at 17:18
  • @MBo, sorry for bothering, but I still dont get it.the formulas you shared in your comment dont give me the expected results, and I dont understand why. For the above formula, I expect s to be "67,661" but instead I get 157,07... i used `a=20` and `t=2Pi` – sharkyenergy Feb 11 '21 at 14:49
  • @sharkyenergy `s=a*t^2/(4Pi) = 20*4*Pi*Pi/ (4Pi) = 20Pi ~ 63` – MBo Feb 12 '21 at 02:24
  • @MBo, thank you, that result I got too somewhere in my trials.. given your main answer with the sentence about it being reliable I was not expecting it to be 63 instead of 67 and assumed there was an error. I need to place a point every 2 mm on a spiral, so a error greather than that is not an option for me. thank you anyway for taking your time! – sharkyenergy Feb 12 '21 at 06:22
  • @sharkyenergy As far as I understand, approximation does not work well for you. In this case you can use numerical methods to find exact value of t for given s, as I wrote in the beginning of my answer (The simplest `bisection or secant methods` should be enough due to monotocity of function) – MBo Feb 12 '21 at 06:30
  • @Mbo thank you.. will have a look at it and try to understand it – sharkyenergy Feb 12 '21 at 07:51