Given a 2D-curve arc $\mathscr{C}$, I would like to be able to easily compute a subset of $n$ points belonging to $\mathscr{C}$, so that the points are separated by equal-length curve arcs.

For that purpose, I'm trying to find a convenient parametric representation of the curve $f : t \mapsto (x(t),y(t))$ (for my purposes, $t \in [0,1])$ such that $\forall t, t'>t$, $\exists v$ such that the length of the arc between $f(t)$ and $f(t')$ is $k(t'-t)$. In other words, if $t$ is time, $f$ describes the trajectory of a material point moving at constant speed $v$ along $\mathscr{C}$.

Thus, my initial problem is solved by the values of $f$ for equally-spaced values of $t$ in [0,1], e.g. if $n = 3$, $\{ f(0), f(\frac{1}{2}), f(1) \}$ is the solution.

In the case of segment [AB], such a parametric curve is easy to find: $f:t \mapsto A + t(\vec{AB})$ works (with $v = AB$). Circle arcs are also pretty nice to me: $t \mapsto r(cos(t), sin(t))$ is such a parametric curve for origin-centered $r$-radius circle, with $k = r$.

I am well-aware that the length of the arc between points $f(t_0)$ and $f(t_1)$ is $ L = \displaystyle \int_{t=t_{0}}^{t_{1}} \sqrt{\displaystyle \left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2}dt$, and my definition of a convenient parametric function must imply that $\sqrt{\displaystyle \left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2}$ is constant and equals $v$.

I'm happy to be able to solve my problem well for circle arcs and segments, but I want more. Segments and circles are pretty simple, I would like to find other classes of curves for which the explicit form of their convenient parametric representation can be known... I've tried setting $x(t)$ to some polynomial function of $t$ and computing the corresponding $y(t)$, turns out there's no such y(t) when x(t)'s degree is stricly more that one... Any suggestions ?

  • 1
    $\begingroup$ It is called arc-length parametrization. Maybe there are better links. This is the first I found. $\endgroup$ – Peyton Jul 29 '17 at 17:37
  • $\begingroup$ So, if $f(r)$ is the function inside the arc-length integral for a given ugly parametrization, then we want $t'(s)=\frac{1}{f(t(s))}$ to have nice (elementary functions as) solutions. $\endgroup$ – Peyton Jul 29 '17 at 17:43
  • $\begingroup$ @Peyton Thanks for the arc-length parametrization name, I couldn't find the right keywords to look up ! $\endgroup$ – Thundzz Jul 29 '17 at 19:43

You are looking in the wrong direction for a solution to the problem. Parametric solutions will not do the trick in most cases. Think of the length of the curve as

$$s=\int ds$$

What you need is the natural equation of the curve, that is, one that is independent of any coordinate system. A common form is one that expresses the curvature as a function of arc length, say, $\kappa=\kappa(s)$. The the Cartesian form can be expressed as (here shown in the complex plane)

$$z=\int e^{i\!\int \kappa(s)~ds}~ds$$

The curve so-expressed will be uniformly spaced along its length.

Unfortunately, natural equations are not easy to come by A few examples include the circle ($\kappa=$constant), Cornu/Euler spiral ($\kappa\propto s$), and logarithmic spiral ($\kappa\propto 1/s$).

Short of having the natural form of the equation, we can get an approximate solution as follows. The arc length is expressed as follows in the complex plane,

$$s=\int |\dot z|~dt$$

where $t$ is a parametric variable. $z$ will be uniformly space in $t$, but not in the real or complex plane. However, if we say

$$\Delta s_n=\int_{t_n}^{t_n+\Delta t}|\dot z|~dt\approx |\dot z|_n\Delta t $$

then we can successively build a curve with uniform $\Delta s$ by choosing

$$\Delta t_n=\frac{\Delta s}{|\dot z|_n}$$

You can find an example of just such a calculation here, complete with a before and after image.

Finally, you can always interpolate the parameterized solution to one that is unifomrly spaced by interpolation.

  • $\begingroup$ Thank you; your solution answers my problem, and I am happy to have learned about it. In the mean time, I have found other less general solutions that solve my particular instance of the problem, which I had not mentioned, and was related to writing text along curves (planetclegg.com/projects/WarpingTextToSplines.html). $\endgroup$ – Thundzz Aug 24 '17 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.