Why 2D linear interpolation formula sums the initial point's y component?

30 Views Asked by At

$$y=y1+(x-x1)\frac{y2-y1}{x2-x1}$$ https://matthew-brett.github.io/teaching/linear_interpolation.html

I've seen this formula in multiple places and I'm wondering why do we need to multiply the distance between $x$ and $x1$ to the slope and add it to $y1$ when this formula would work just the same: $$y=x\frac{y2-y1}{x2-x1}$$

1

There are 1 best solutions below

0
On BEST ANSWER

The two formulas only give the same result if the line goes through the origin. The first formula is the correct one.