3

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.

Ali
  • 1,399
Louis93
  • 227

3 Answers3

6

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.

copper.hat
  • 172,524
  • So to understand this better, x1,y1 and x2,y2 map onto the two points at either end of our line segment. Using this method is there a way to figure out the coordinate with the input being the x-value? Or is the only way to do that to use the equation of a line? – Louis93 Jun 25 '13 at 04:54
  • If $x_1 \neq x_2$, you can do that, either using @nbubis' formula, or using $t=\frac{x-x_1}{x_2-x_1}$, and then computing $p(t)$. – copper.hat Jun 25 '13 at 06:12
  • Excellent, thank you! – Louis93 Jun 25 '13 at 11:20
2

There is a more general concept known as convex set. If you consider $u=(3,1)$ and $v=(2,4)$, then the vector

$$ w=\lambda u+(1-\lambda)v,\quad \lambda\in [0,1] $$

gives the answer.

1

This is just the equation of the straight line:

$$y - y_1 = \frac{y_2-y_1}{x_2-x_1}(x-x_1)$$ Plug in your values for $(x_1,y_1), (x_2, y_2)$ and then given some value of $y$ you can solve for $x$.