Find linear equation from graph (piecewise function)

129 Views Asked by At

I want to find the piecewise function in the following graph: enter image description here

From the graph I have the following intervals \begin{equation} G(f)= \begin{cases} \begin{alignedat}{3} &0, \quad & f&<-30M\\ &?, \quad & -30M\leq f &\leq -15 M\\ &C, \quad & -15M<f &<15M\\ &?, \quad & 15\leq f &\leq 30 M\\ &0, \quad & f&>30M \end{alignedat} \end{cases} \end{equation}

The straight line between $15M\leq f\leq 30M$:

Two points: $(15M,C)$ and $(30M,0)$, the slope is $$ k=\frac{y_2-y_1}{x_2-x_1}=\frac{C-0}{15M-30M}=-\frac{C}{15M} $$ So $$G(f)=-\frac{C}{15M}f$$ But for $f=15M$ I have $G(15M)=-C$ and for $f=30M$ I have $G(30M)=-2C$?

What have I missed?

1

There are 1 best solutions below

0
On

You can use the 2 point form of a line ie $\,y-y_1= \frac{y_2-y_1}{x_2-x_1}.(x-x_1)$, where the 2 points are $\,(x_1,y_1)$ and $\,(x_2,y_2)$

So in your case ,for $15M\leq f\leq 30M$ the equation becomes : $\,G(f)-0=\frac{C-0}{15M-30M}.(f-30M)\\G(f) = \frac{-C}{15M}f+2M$