I'm trying to draw on the computer a curve that keeps always the same distance(given as parameter) from a given curve. I know the formula for the given curve. I tried moving perpendicular to the first derivative but in some cases when the curve is sharp there are a lot of points creating some problems. This problem happens when the moving the curve with a distance greater that the radius of the curve.


Is there a simple/standard way of drawing this kind of drawing?


To be more precise I'm using [these](http://mathworld.wolfram.com/ParallelCurves.html) ("Parallel Curves") formulas when obtaining the above result. It works fine as long as the curve has no "sharp turns". This is the case that bothers me.


Thank you,


Iulian



Formulas for equidistant curves
If you just want a good easy picture, the simplest thing to do, as sugggested by Charles Matthews' comment, is to draw lots of equal radius circles centered about points on the curve. Your eye and brain will see the envelope. You could also draw lots of disks, or just use a computer drawing program such as Adobe Illustrator, make two copies of the curve (for instance on different layers) and give the lower copy a large stroke-width and a light color. (You can start from a PDF file that contains the mathematical curve, open it in Illustrator or a similar program, and edit as above).


If you want a more mathematical description or construction, the equidistant curves for a smooth curve $\gamma$ depend on the cut locus for $\gamma$. The cut locus is the set of points where there is more than one closest point on $\gamma$, and it is closely related to the whole theory of Voronoi diagrams. You can compute a good approximation of it from a Voronoi diagram program or a convex hull program,
if you lift the curve to the paraboloid $z = x^2 + y^2 \subset \mathbb R^3$. In the complement of the cut locus, there is a smooth map $(x, y) \to C(x, y)$ where $C(x,y)$ is the closest point on $\gamma$; it can be traced out implicitly, it's the inverse function to what you're already doing. For a generic smooth curve, the cut locus is a piecewise smooth tree, whose endpoints are centers of osculating circles where the curvature of $\gamma$ has a local maximum. (However, in general, the cut locus can be quite complicated and have infinitely many branches, even for a $C^\infty$ curve). The edges of the cut locus can be traced from these endpoints, using the implicit function theorem; the main difficulty is keeping track of enough information to get the correct combinatorics for the graph. It's equivalent to the problem of constructing the convex hull of a simple curve on the paraboloid above.


