Plotting a Curve Between Two Other Curves

81 Views Asked by At

Suppose you have two curves, f and g. The first function, for example, could be sin(x) and the second, g, could be cos(x). You can also think of f and g as concentric circles, for example. Suppose I have a third function, h(x) which for example could be sin(10 x), i.e., a higher frequency sine wave. The question is how to plot h(x) so that it lies entirely between the two curves f and g. In other words, we need to modify h(x) before plotting so that the resulting plot is entirely bounded by f(x) and g(x).

See an example at https://www.oberonplace.com/products/securidesign/pattern.htm

3

There are 3 best solutions below

1
On BEST ANSWER

Define for any $m, 0 \le m \le 1$ the family of functions

$$h_m(x):=(1-m)*f(x)+m*g(x)$$

(barycentrical weighing).

Their graphical representation will be situated in between the graphical representation of $f=h_0$ and $g=h_1$.

This (classical) operation is called in certain cases an homotopy.

4
On

You can define $h(x)$ parametrically, by introducing a parameter $t$.

$$h(x)=tf(x)+(1-t)g(x)$$

where $0\le t\le1$, generates a curve which is completely contained between $f(x)$ and $g(x)$. Observe that, when $t=1$, you get $f(x)$ and when you have $t=0$, you get $g(x)$. To make $h(x)$ completely contained inside $f(x)$ and $g(x)$, you can omit the endpoints $0, 1$ from $t$.

1
On

Disclaimer: There is no bypassing the use of vector calculus.

You likely want to plot some function $h(t)$ with respect to the basis vectors that change scale with parameter $t$. This requires some understanding of vectors and spaces as opposed to equalities which define curves. For example, suppose I wanted to plot $\sin(x)$ between $x+\sqrt{2},x-\sqrt{2}$ in the way I think you mean. Then such a curve would be

$$\frac{1}{\sqrt{2}}(t\vec{e}_1+\sin t \vec{e}_2)$$ where $\vec{e}_1=(1,1),\vec{e}_2=(-1,1)$ where the vector $(a,b)$ is written in terms of the original basis $\vec{e}_x=(1,0),\vec{e}_y=(0,1).$ This would look like:

$$\frac{1}{\sqrt{2}}\left(t-\sin t,t+\sin t\right)$$ in the original basis (plot this in Desmos). Now, ideally they would scale according to some functions $f,g$. Now, let's say we've parametrized the curves defining $f,g$ according to their arc length and call them $p(s),q(s)$. Define $\vec{e}_1=\frac{d}{ds}\frac{p+q}{2},\vec{e}_2=\frac{d^2}{ds^2}\frac{p+q}{2}$ and write your function as $\frac{|p-q|}{|\left(t\vec{e}_1+h(t)\vec{e}_2\right)|}\left(t\vec{e}_1+h(t)\vec{e}_2\right).$ $t$ is a parameter that depends on $s$. If I haven't made any mistakes, that should do it.

Indeed, you don't necessarily need to have $\frac{p+q}{2}$ be the curve defining the axis. In fact, one can have (what everyone else was saying) $\nu p+(1-\nu)q$ for any $|\nu|<1$.