Calculating the Exact Midline Between Two Shifted Sine Curves

123 Views Asked by At

I have two identical sine curves, simply shifted by some value $y_0$.

How can I find the exact midline between the two curves?

If one takes the average of the y-values, you get close but if you look at this circle centered on the midline calculated in this way, it does not evenly touch both curves, showing the small error in the midline calculation.

enter image description here

4

There are 4 best solutions below

9
On BEST ANSWER

In response to the OPs desire for the two primary curves to be parallel sine waves, I've developed an algorithm for the locus of circle centers that lie within the prescribed envelop. Note that the results shown below were developed for a proof of principle, rather than exact accuracy.

The crux of the method is outlined here:

  1. Define the upper and lower curves, say

$$ y_{u,l}=\sin x \pm d \quad \text{ or }\quad z_{u,l}(t)=t+i(\sin t \pm d) $$

  1. Choose a point on the lower curve, say, $z_{l}(t_1)$

  2. The unit normal vector to $z_{l}(t)$ is

$$ z_n(t)=i\frac{\dot z_l}{|z_l|} $$

  1. Guess the radius, $r$ of the desired circle and place it at $z_c=z_{l}(t_1)+rz_n(t_1)$. This circle will kiss the lower sine wave.

  2. Iterate on $r$ until the circle just kisses the upper sine wave without crossing it.

  3. Repeat for as many points along $z_l$ as desired.

Now, there are inherent problems with (a) machine accuracy, (b) curvature of the sine wave, (c) distance between curves, etc. Every calculation will have to be manually guided for a successful calculation.

I have implemented a quick and dirty brute force iteration for the proof of principle. There are two examples, with $d=0.5$ and $d=1$ that are shown below. Shown are the two sine waves, a sampling of embedded circles, the locus of the circle centers (in red), and the average of the two sine waves (in blue). The locus and the average are quite similar in both figures. But the correlation is deteriorated with increased spacing of the curves. We anticipate that will worsen with increased spacing or slope of the curves (e.g, $y=\sin 2x \pm d$).

d=1/2

d=2

2
On

I think the way you are looking at this is, at best, very difficult. My appraoch is perhaps the backward version. I start with a sine wave and build parallel curves above and below. This is very easy to do in complex variables. If $z(t)=t+i\sin t$, the upper and lower curves, at a normal distance $d$ from $z$, are given by

$$ z_{d^\pm}-z\pm id\frac{\dot z}{|z|} $$

(A Cartesian version can be found in Wikipedia.)

The figure below shows an example calculation with $d=.5$. Notice that the parallel curves are decidedly not either sine waves or equal to each other.

ParallelCurveExample

1
On

A mid-curve of given curvature $1/\rho$ can define two curves as having curvature radii of equal offset $c$

$$\rho \pm c $$

In this case the three curves have the same slope of their normals at respective points.

If the given two curves form one of two sets of orthogonal trajectories then it is possible to easily define a mid-curve.

But in general we need to know the commonality of the given lines so as to define the "mid-line".

I.e., integrands of a differential equation the arbitrary constant $0$ can be replaced by $\pm c/2$ in your sketched example.

In 3-space surfaces we have Bertrand parallel surfaces. The above suggestion is for the particular plane case.

1
On

Sorry, no answer but a question. Is the black point in this example part of what you consider the midline? Is it defined by the center line of tangent circles? enter image description here

If your answer is yes, consider the following. The midline curve would be the same between the orange and blue curves, and between the blue and black curve. The midline curve so considered, is kind of a regularizer of the concave sections between the two curves...

enter image description here