0

$$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 Answers1

1

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

Hans Lundmark
  • 53,395