How to compute an old style shore line drawing?
Define a level function curve (L) like this:

$$ L(x,y) = C_0 \cdot x + C_1 \cdot y + C_2 \cdot x^2 + C_3 \cdot xy + C_4 \cdot y^2 .... $$

It has no constanst term.  Now, find the best fit to the level curve $L(x,y)=1$.  This will yield the values for the coefficients.

Normalize the coefficients so the gradient is of a magnitude you like.

Find the level curves of $L(x,y)=t$ where $t$ is near one.

Finding the best fit is done with Linear Algebra.  Finding the level curves is an interative search algorithm.