How can I build this function?

68 Views Asked by At

I want to build a function $f(t)$. The function is simple but has some constraints:

enter image description here

  • $t$ goes from $0$ to $1$
  • $f(0) = 0$, $f(0.5) = 1$ and $f(1) = 0$
  • $f$ is linear from $0$ to $0.5$ and from $0.5$ to $1$

How can I build such function?


What I thought: I started with $f(t) = -|t|$, then I added $1$, hence $f(t) = 1 - |t|$.

enter image description here

But I don't know how to drag this function.

1

There are 1 best solutions below

1
On BEST ANSWER

enter image description here

The green line is the function you ended up with: $f(t) = 1-|t|$.

To transform it to the red function (so it is shrunk in half with respect to the y-axis), we set $g(t) = f(2t) = 1-|2t|$.

Finally to transform this to the blue function, we translate the graph to the right by $0.5$ units.

This is done by setting $h(t) = g(t-0.5) = 1-|2(t-0.5)| = 1-|2t-1|$.

Hence your function would be $h(t)$ defined on the interval $[0,1]$.