0

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

  • 1
    Take $h_m(x)=mf(x)+(1-m)g(x)$ for any $m$, $0<m<1$. – Jean Marie Jun 26 '21 at 13:44
  • @JeanMarie Thanks for your response. I have my own $h(x$ funtion -- say $h(x) = 3 cos(x) + 4 sin(5x)$. How do I use my function in your formulation? – Para Parasolian Jun 27 '21 at 14:13
  • You have to divide it by 7: $(3/7)\cos(x)+(4/7) \sin(x)$ in order that the sum of coefficients is one. – Jean Marie Jun 27 '21 at 19:05
  • @JeanMarie I think I get your drift. (1) I would add 7 to $h(x)$ and then divide by 7 to ensure that the value is between 0 and 1 (handling negative values of $sin(x)$, e.g. (2) Replace $m$ in your formulation with this new $h(x)$. If you agree and answer my question (rather than as a comment) I will accept it. – Para Parasolian Jun 29 '21 at 16:07

3 Answers3

1

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.

Jean Marie
  • 81,803
  • I have used your formulation (same as the answer given by Soham. I have set m to be the function $h(x)$ which has been "normalized" so the values of m are between 0 and 1. An example is at [https://www.flickr.com/photos/dattatreya/51284165797/] – Para Parasolian Jul 02 '21 at 13:20
0

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$.

Soham
  • 9,990
  • Thanks for your answer. I see clearly how your $h(x)$ lies entirely between $f(x)$ and $g(x)$ for any $x$. But, I have my own $h(x)$ funtion -- say, $h(x) = 3 cos(x) + 4 sin(5x).$ How do I use my $h(x)$ function in your formulation? – Para Parasolian Jun 27 '21 at 14:14
  • @ParaParasolian What do you mean by "my own h(x) function"? Can you be a bit more clear please? – Soham Jun 27 '21 at 14:35
  • Using the simplest possible function, let us use: $f(x) = (x - 2)$ and $g(x) = (x+2).$ These are just two parallel lines at an angle of $45 degrees$ to the x-axis. Suppose my function, $h(x) = sin(x).$ What I would want then is to plot $sin(x)$ between these the two parallel lines above. – Para Parasolian Jun 29 '21 at 16:03
  • @ParaParasolian $\sin x$ is defined for all real numbers, whereas, $(x-2)$ intersects the $x$ axis at $x=2$ and $x+2$ at $x=-2$. So, theres no way to restrict $\sin x$ inside $x=[-2,2]$ without restricting its domain. – Soham Jun 29 '21 at 16:09
0

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$.