Which algorithm could be used to compare two waveforms from an oscilloscope in XY mode? I would like to receive some hint as to which algorithm could be used to compare two waveforms from an oscilloscope in XY mode, as shown in the image:

Note that the image shows a percentage difference (displayed in red) between the two curves (one yellow, one blue).
It is this percentage value that I would like to obtain.
I understand that the curves are produced point to point (x, y) and then a sequence of position data (x, y) is generated:

I believe that the algorithm would have to compare two data arrays.
Does anyone have any idea how to do this?
Thank you.
Edit: Following the formula of the video (Normalized Correlation), I believe that the result of comparison is interesting, my next step is to try to do it with a microcontroller to find out if it will have resources.
Note: After calculating the correlation for each axis, I multiplied the result of the axes and inverted the result, to show the difference. If this is not correct, please comment on any suggestions.

Ref.:

Normalized cross-correlation is also the comparison of two time
series, but using a different scoring result. Instead of simple
cross-correlation, it can compare metrics with different value ranges.

Source: https://anomaly.io/understand-auto-cross-correlation-normalized-shift/index.html
Edit (03/14/2021):
In addition, the measurement is performed with a dedicated microcontroller and synchronized with the frequency of the sine wave, that is, the number of readings is fixed.
The basic circuit:


The name “Octopus” maybe doesn’t say anything alone but if you google
it along the words “curve tracer” you will obtain thousands of
result.In few words an “Octopus” curve tracer is a small circuit that
used in conjunction with a scope allows to display  the voltage across
a component under test on horizontal (X) axis versus the current
through that component on the vertical (Y) axis.A scope set to X-Y
mode is required (most of them have this feature).


This   circuit will produce a “signature” waveform on the oscilloscope
to aid in the testing and analysis of shorts, opens, and leakage in
just about any electronic component including resistors, capacitors,
inductors, diodes,transistors and digital ICs too.Each component has a
characteristic waveform (called “Lissajous” pattern), some examples:


Source: https://www.jammarcade.net/simple-component-tester-a-k-a-octopus-curve-tracer/
You can't get the exact value because you don't know how log the signals spent at each stage.
Consider the case where you have two square with period 1, and shifted by $\delta$ compared to each other.
The XY plot will always be a rectangle with the width corresponding to the amplitude of the X signal and height corresponding to the amplitude of the Y signal. In other words, you have always the same input for your function to compute the correlation, while the correct output varies.
You still can get an idea of how similar two signals are, but it is not the signal cross correlation