3

I'm trying to fit a function to data points. The data generally resembles a butterfly/lemniscate shape, see drawing.

The problem is that the shape in my data can be rotated, skewed and/or non-symmetrical.

I've been looking at Bernoulli's, Devil's curve, Watt's curve, however, these are, as far as I can see, symmetrical.

Does anyone know of a plane curve that is able to represent the example shapes? Preferably in Cartesian coordinates.

enter image description here

Ben
  • 131
  • I'm almost sure a have a book on this at home, I'm searching right now. But my idea would be to look at a general homogeneous polynomial form (now I'm just not sure whether it was a cubic or a quartic form, or a combination... I remember someday reading something about it) – Henrique Augusto Souza Jun 01 '16 at 14:40
  • Maybe, another possibility, would be taking the standard Bernoulli's curve parametrization and taking into account deformations of space, then you would be actually trying to fit the deformation of the plane that best fit's your data to a standard Bernoulli's curve. Just a intuition, not even remotely sure about how that can be derived algebraically. – Henrique Augusto Souza Jun 01 '16 at 14:42
  • @Ben What does your data look like? Do your data points have a time parameter? – Anon Jun 01 '16 at 14:46
  • @McFry every point indeed has a corresponding time parameter. Note that the data drawn can be more noisy in practice, I'll generate a figure as soon as possible. – Ben Jun 01 '16 at 14:50
  • 1
    @Ben In that case you do not need to care about the topological shape of the curve. Instead, you can describe both coordinates individually as periodic functions of time. If you know the period $p$, you will want to consider using regression to find an approximation $x(t) = c + \sum_{k=1}^n(a_k\cos(2\pi kt/p) + b_k\sin(2\pi kt/p))$, similar for $y(t)$. For $n=1$ you will be able to approximate only ellipses, so you want to choose at least $n=2$. – Anon Jun 01 '16 at 15:31

3 Answers3

3

Mathematical Models, H.M. Cundy and A.P. Rollet, page 71:

$\vdots$

Interesting Quartics

$\vdots$

(8) $x^4 = x^2 - y^2$ (lemniscate)

Playing with geogebra, I think I found a nice generalization of the lemniscate that you can use. It's the following equation:

$$a(x- c_1)^4 -b(x - c_1)^2 + c(y - c_2)^2 + d(x - c_1)(y - c_2) + e(x - c_1)^3 = 0$$

Playing with the parameters, seemes like I can deform the lemniscate on the plane (including asymmetric deformations) at will. I will upload a GeoGebra app soon, so you can see it for yourself.

Surely, maybe including more terms would make it more general, and might capture a deformation that's missing. I've tried a few terms (like $y^3$), but any coefficient other then 0 would destroy the lemniscate shape. Also, this is not rigorous in any kind, it's purely empirical, so I would watch out before using it on any real application.

EDIT: Here's my GeoGebra file. Also, as a note, check that are bounds for some of the coefficients used, otherwise the lemniscate form is also lost.

2

Can you consider free form curves such as Bezier ?

enter image description here


You can also use a standard lemniscate and deform its plane, for instance by an homographic transform.

enter image description here

  • Splines would be less useful, but using a standard lemniscate might be a very good idea, the only thing to solve would be the transform parameters. I'll give it a try – Ben Jun 01 '16 at 16:20
2

There is a polar asymmetric modelling for the lemniscate:

Asymmetric lemniscate

which you can rotate and scale more easily that in Cartesian coordinates (but easy to convert). Such parameterizations are used very often as they can be less troublesome to fit.

Similar curves in astronomy are also called analemmas:

Analemma.

From an image processing fit point of view, you can consult: A Unified Scheme for Detecting Fundamental Curves in Binary Edge Images, Asano, Tetsuo et al., Computational Geometry, 2001