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?
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?
-
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? Sincet
is not defined, it could be infinite. And you can't deal withinfinity
in a finite context. Please rewise and update your question. – Thomas Commented Jun 24, 2017 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 Commented Jun 24, 2017 at 21:55
-
1
Then how about
for(var i=0; i<n; ++i) console.log({x: i*r*Math.PI*2, y:0 })
? All points are on the parametric spiral and all exactly byr*Math.PI*2
away from each other. – Thomas Commented Jun 24, 2017 at 22:06 -
1
I'm not an expert but I'm fairly sure a curve with
y = 0
isn't a spiral – snazzybouche Commented Jun 24, 2017 at 23:00
1 Answer
Reset to default 8You want to place points equidistantly corresponding to arc length. Arc length for Archimedean spiral (formula 4) is rather plex
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