1. What I want
I would like to plot parametric curves approximately like these:
2. What I did
I googled parallel curves and found this resource function:
I took its definitions:
J[{x_, y_}] := {-y, x};
L[v0_] := Sqrt @ Simplify[v0 . v0]
ParallelCurve[a_, r_, t_] :=
Module[{d}, d = D[a, t];
a + r J[d] / L[d]]
and applied them to an eight curve:
eightc = {Sin[u], Sin[2 u]};
eightp = ParallelCurve[eightc, 0.1, u]
{(-0.2 * Cos[2 * u])/Sqrt[Cos[u]^2 + 4 * Cos[2 * u]^2] + Sin[u], (0.1 * Cos[u])/Sqrt[Cos[u]^2 + 4 * Cos[2 * u]^2] + Sin[2 * u]}
3. What I got
ParametricPlot[{eightc, eightp}, {u, 0, 2 Pi},
ImageSize -> Large,
AspectRatio -> 1/2,
PlotPoints -> 60,
PlotStyle -> Gray]
Very disappointing, because the two curves are not parallel at all.
4. Questions
How can I get truly parallel curves?
How can I put the ties (normals) between them?














AspectRatio -> 1. ForAspectRatio -> ar, usinga + {1, 1/aratio} r J[d]/L[d]in the definition ofParallelCurvemakes curves look parallel. However, for this particular example, using this approach we get is a small bump atu = Pi/4and atu =3Pi/4. – kglr Oct 07 '23 at 10:37