[Math] Given a set of sets of points, can one determine if a straight line exists that intercepts through a point in each set, and the line’s formula

algebra-precalculusgraphing-functions

I have a problem where I have a set of sets of points. I need to determine if I can make a straight line that intercepts through one point in each set of points and the formula of that line.

Is there a mathematical way to do this? Maybe with using some trial and error method?

Edit: The points are (x,y) coordinates. You can consider these points to be given.

For example, I can have a straight line intercepting (2,1)(3,2)(4,3) but cannot for the case of (2,1)(3,2)(4,3.5).

.

Best Answer

Consider two points with coordinates $(x_1,y_1),(x_2,y_2)$. Then the coordinates $(x,y)$ of any point on the line $L_{1,2}$ through $(x_1,y_1)$ and $(x_2,y_2)$ satisfy the equations $$ \begin{cases} x = x_1 + t (x_2 - x_1) \\ y = y_1 + t (y_2 - y_1) \end{cases} $$ which are called the parametric equations of $L_{1,2}$. You can get the Cartesian equation of $L_{1,2}$ by solving for $t$: $$ y = y_1 + (x - x_1) \frac{y_2 - y_1}{x_2 - x_1} $$ Moreover, a third point $(x_3,y_3)$ lies on $L_{1,2}$ if and only if $$ \begin{cases} x_3 = x_1 + t (x_2 - x_1) \\ y_3 = y_1 + t (y_2 - y_1) \end{cases} \leftrightarrow \begin{cases} x_3 - x_1 = t (x_2 - x_1) \\ y_3 - y_1 = t (y_2 - y_1) \end{cases} $$ that is to say, if and only if $$ \frac{x_3 - x_1}{x_2 - x_1} = \frac{y_3 - y_1}{y_2 - y_1} $$ i.e. if and only if the slope of $L_{1,2}$ and the slope of the line through $(x_1,y_1)$ and $(x_3,y_3)$ are the same. Note that to account for vertical lines it is better to check if $$ (x_3 - x_1)(y_2 - y_1) = (x_2 - x_1)(y_3 - y_1) $$


Indeed, this is apparent from the geometric picture, too. Note that here I'm going to assume that the coordinates of your points are real numbers, but that's just to fix ideas.

Fix a point $p$ in the plane. Then there is a $1:1$ correspondence between the lines through $p$ and the set $\Bbb{R} \cup \{\infty\}$, where to the vertical line corresponds the symbol $\infty$ and to every other line corresponds its slope.

Since the points $s,r,p$ are collinear (i.e. lie on the same line) if and only if the lines $L_{p,s} = \langle p,s \rangle$ and $L_{p,r} = \langle p,r \rangle$ coincide, it follows that $s,r,p$ are collinear if and only if the "numbers" corresponding to $L_{p,s}$ and $L_{p,r}$ are the same.

Related Question