There are two charts (two broken lines). Graphics are built on points in a rectangular coordinate system.
X-axis - time, y-axis values. The simplest graphics.
The number of points in both graphs is always the same. (Each time is measured value and "apply" on each graph.)
Values (y-axis) at points can be very different. From very large to very small.
And if you draw these two graphs in one coordinate system we'll get straight lines.
You need to scale the graphics, in order to evaluate their shape relative to each other.How to resize two graphics to compare their shapes?
While the algorithm (and may be wrong) like this.
For each graph compute (your) coefficientpossible.
This looking for on the chart and minimalizarea maximilienne.
Next when graphing multiply the point value (along the y axis of course since x we have time and we generally do not touch) on coefficientpossible.