My Technical Notes

Tuesday, 20 June 2017

Finding Simple Linear Relationship

Given two data points: $$f(13.5) = 1$$ $$f(6) = 0.5$$ Let's say that the graph is linear like the sort $[f(x)=mx+c], how do I find out $[m] and $[c]?

The gradient between any two points $[(x_1, y_1)] and $[(x_2,y_2)] is $$ \frac{y_2 - y_1}{x_2 - x_1} $$ which is equals $[\frac{2}{30}] or $[0.066666...] Therefore we have $$f(x) = \frac{2}{30}x + c$$ so combining and simplifiying the two equations: $$1=\frac{2}{30}*13.5 + c$$ $$0.5=\frac{2}{30}*6 + c$$ We get $[c=0.1] To sum up, with $[m = \frac{2}{30}] and $[c=0.1], the formula is: $$f(x) = \frac{2}{30}x + 0.1$$

No comments: