Shifting points function

33 Views Asked by At

I need to solve the following problem. I have a dataset of points that describes a triangular curve. Now, I need to change the shape of the curve by decreasing the slope of the curve as in the image attached, i.e. transforming curve 1 into curve 2 with reference to the attached image. To do that, I need to shift the points on the x-axis, so that that the peak of the x-position stay fixed and also the extremes on the x-axis don't change. That means, for example, that I would like to shift the position of the points x=2 and x=4 of the original curve by a certain amount while all the other points move accordingly to the above-mentioned constraint. Is there any kind of function that I can apply?

graph

1

There are 1 best solutions below

3
On

What you want here is for each point on the curve 1 $(x,f(x))$ to stretch outwards by a factor of 2, relative to $x=3$.

Let's consider the x-coordinate.

If $x \geq 3$, the distance from $3$ to $x$ is $(x-3)$. Since we want to stretch it outwards by a factor of 2, the resulting distance will be double of that i.e. $2(x-3)$. The coordinate will then be $$\underbrace{x}_{\text{original coordinate}} + \underbrace{2(x-3)}_{\text{new distance}} = 3x-6$$

Similar if $x<3$, distance $=(3-x)$, new distance $=2(3-x)$ and new coordinate will be $$\underbrace{x}_{\text{original coordinate}} - \underbrace{2(3-x)}_{\text{new distance}} = 3x-6$$

Therefore, the new coordinate shall be $3x-6$, or in other words the point $(x,f(x))$ maps to the point $(3x-6,f(x))$. Writing $x'=3x-6,x=\frac{x'+6}{3}$ and the point is $(x',f(\frac{x'+6}{3}))$.

Therefore, the transformation you need is new curve $\fbox{$g(x)=f(\frac{x+6}{3})$}$


Verification:

Original curve is $$f(x)=1-|\frac{|x-4|-|x-2|}{2}|$$

New curve is $$\begin{align*}g(x)&=1-|\frac{|\frac{x+6}{3}-4|-|\frac{x+6}{3}-2|}{2}|\\&=1-|\frac{|x-6|-|x|}{6}|\end{align*}$$

You can verify by graphing that these curves indeed matches your given diagrams.

Hope this helps!

Gareth