Search code examples
pythonalgorithm2dcurveintegral

Is there an algorithm to calculate the area of a Lissajous figure?


Suppose I have measurements of two signals

V = V(t) and U = U(t) 

that are periodic in time with a phase difference between them. When plotted against each other in a graph V vs U they form a Lissajous figure, and I want to calculate the area inside it.

Is there an algorithm for such calculation?

I would like to solve this problem using Python. But a response in any language or an algorithm to do it will be very appreciated.

Examples of V and U signals can be generated using expressions like:

V(t) = V0*sin(2*pi*t) ; U(t) = U0*sin(2*pi*t + delta)

Figure 1 shows a graph of V,U vs t for V0=10, U0=5, t=np.arange(0.0,2.0,0.01) and delta = pi/5.

img1

And Figure 2 shows the corresponding Lissajous figure V vs U.

img2

This is an specific problem of a more general question: How to calculate a closed path integral obtained with a discrete (x_i,y_i) data set?


Solution

  • To find area of (closed) parametric curve in Cartesian coordinates, you can use Green's theorem (4-th formula here)

    A = 1/2 * Abs(Integral[t=0..t=period] {(V(t) * U'(t) - V'(t) * U(t))dt})
    

    But remember that interpretation - what is real area under self-intersected curves - is ambiguous, as @algrid noticed in comments