Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 754
Fellype do Nascimento Avatar asked Dec 07 '25 08:12

Fellype do Nascimento


2 Answers

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

like image 99
MBo Avatar answered Dec 09 '25 21:12

MBo


for the outer most curves area of usual Lissajous shapes I would try this:

  1. find period of signal

    so find T such:

    U(t) = U(t+T)
    V(t) = V(t+T)
    
  2. sample data on t=<0,T>

    I would use polar coordinate system with center equal to average U,V coordinate on interval t=<0,T> and call it U0,V0. Convert and store the data in polar coordinates so:

    a(t)=atan2( V(t)-V0 , U(t)-U0 )
    r(t)=sqrt( (U(t)-U0)^2 + (V(t)-V0)^2 )
    

    and remember only the points with max radius for each angle position. That can be done either with arrays (limiting precision in angle) or geometricaly by computing polyline intersection with overlapping segments. and removing inside parts.

  3. Compute the area from sampled data

    So compute the the area by summing the pie triangles for each angular position covering whole circle.

This may not work for exotic shapes.

like image 43
Spektre Avatar answered Dec 09 '25 22:12

Spektre



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!