  We present a generic solution to the fundamental problem of how to connect
two points in a plane by a smooth curve that goes through these points with a
given slope. The smoothness of any curve depends both on its curvature and its
length. The smoothest curves correspond to a particular compromise between
minimal curvature and minimal length. They can be described by a class of
functions that satisfy certain boundary conditions and minimize a weight
functional. The value of this functional is given essentially by the average of
the curvature raised to some power \nu times the length of the curve. The
parameter \nu determines the importance of minimal curvature with respect to
minimal length. In order to find the functions that obtain the minimal weight,
we use extensively notions that are well-known in classical mechanics. The
minimization of the weight functional via the Euler-Lagrange formalism leads to
a highly non-trivial differential equation. Using the symmetries of the problem
it is possible to find conserved quantities, that help to simplify the problem
to a level where the solution functions can be written in a closed form for any
given \nu. Applying the appropriate coordinate transformation to these
solutions allows to adjust them to all possible boundary conditions.
