[Math] How to find out the coordinates of every point between two points

geometry

Suppose all I am given, is the coordinates of two points like the following:

enter image description here

What are some ways I could go about finding the values of every point on this line segment? Like the y-value at 2.3, 2.4, 2.7 etc.

Any suggestions as to how I could go about doing this would be appreciated.

Best Answer

Here is another way. Choose $t \in [0,1]$, then let $p(t) = (x_1+ t (x_2-x_1), y_1+t(y_2-y_1))$.

Then $p(0) = (x_1,y_1)$, $p(1) = (x_2,y_2)$ and for $t \in (0,1)$, $p(t)$ will be a point in between.

This scheme works even if the two $x$ coordinates are the same.