8
$\begingroup$

A common question is to prove/disprove that three points in $\mathbb{R}^2$ are colinear. For, example

Show that $(-1, 8)$, $(1, -2)$ and $(2, 1)$ lie on a common line.

What are some methods one could use to answer questions of this nature?

  • 8
    Since this statement is false, showing it to be true will be rather difficult.2011-05-10
  • 2
    There is one and only one line through any two points. Find the line through $(-1,8)$ and $(1,-2)$, and check to see if it contains $(2,1)$. If it does, then this proves the statement. If it doesn't, then it shows the statement is false. You can use the two-point formula to find the equation of the first line.2011-05-10
  • 2
    hmm, $(2,1)-(1,-2)=(1,3)$, $(1,-2)-(-1,8)=(2,-10)$ - apparently you wanted to write $(-1,-8)$ (then $(1,-2)-(-1,-8)=(2,6)=2(1,3)$, so they are on a line)2011-05-10
  • 0
    @user8268, I don't understand what you did there please2011-05-10
  • 0
    @MartianInvader, would need to show how I arrived at it being false though2011-05-10
  • 0
    @Arturo Magidin, I assume, when you say Two-point formulae, you are referring to the equation of a line, but we are not given an m in this case. Do I assume m to be 1 or 0 in this case?2011-05-10
  • 0
    @user You can find $m$ given two points by the formula $(y_2-y_1)/(x_2-x_1)$.2011-05-10
  • 0
    The slope of a line passing through two points is determined by the two-point formula. How do you define slope? Do remember how you can compute it in terms of $(y_2 - y_1)$ and $(x_2 - x_1)$, also known as rise-over-run. slope = rise/run (rise is difference between y's, run is difference between x's). Then you can create your formula by using the two point formula. @yunone: I was composing and didn't catch that meanwhile, you posted the slope derivation.2011-05-10
  • 0
    @user10695: Call the three points $A$, $B$, and $C$\,. What is the **slope** of the line that goes through $A$ and $B$? What is the slope of the line that goes through $B$ and $C$? Conclusion?2011-05-10
  • 0
    @Amy, same has happened to me before. Your comment is more detailed, and thus probably more helpful.2011-05-10
  • 0
    I remember how to use the equation of a line. And I get y2-y1/x2-x1. In this case, am I to assume that m will be or should be zero, if I am not given that? From the previous answer post, I was able to get P1-P3 and P2-P3 but after that, I got lost.2011-05-10
  • 0
    Do, I find m for the first two points and then see if I get m for the second set and the if not equal, conclude that they are not on the same line?2011-05-10
  • 0
    See my answer below: m (slope) = $$\frac{(y_2-y_1)}{x_2-x_1}.$$ No need to "assume" any value for m; the slope of line is precisely what you give in above (though to avoid ambiguity in terms of what is dividing what, you should use parentheses to enclose the numerator and the denominator.)2011-05-10
  • 0
    I should have enclosed the denominator in parentheses above. At any rate, to answer your last question, yes: provided by "second set" you mean one of the original points used to determine the slope of the line passing through first pair, along with the third point you want to test. Then, if the two computations for slope aren't equal, you know the third point doesn't lie on the line.2011-05-10
  • 1
    @user10695: When I say "the point formula", I mean the formula for finding the equation of a line when you are given two points on a line; that formula does **not** require you to know the value of $m$, this value is *computed*. Perhaps you are confusing it with the point-slope formula.2011-05-10
  • 0
    Thank you very much all for taking time to explain this one for me.:)2011-05-11
  • 0
    The points $(-1, 8)$, $(1, -2)$ & $(2, 1)$ will lie on the same line if the area of triangle, having vertices at the given points, is zero. Mathematically, $$\frac{1}{2}\left|x_1(y_2-y_3)+x_2(y_3-y_1)+x_3(y_1-y_2)\right|=0$$2015-07-03

5 Answers 5

13

Since there seems to be some confusion as to the fit of $(-1,8)$ vs. $(-1,-8)$, try to use the other two points.

So say that point $a$ is $(x_1, y_1)$, point $b$ is $(x_2, y_2)$, and we'll start with the assumption that $x_1\neq x_2$.

The general "two-point" formula for the equation of a line (given two points) is given by:

$$(y - y_1) = \frac{(y_2 - y_1)} {(x_2 - x_1)} (x-x_1)\quad\quad\quad(1)$$

where $$\frac{(y_2 - y_1)} {(x_2 - x_1)} = m $$

($m$ represents the slope of the line). You the need to simplify the equation by solving for $y$ and putting the equation, e.g., in slope-intercept form: $y = mx + b$ where $b$ is the $y$-intercept (the value of $y$ when $x = 0$). Then you need then to substitute the $x$-coordinate of the third point for $x$ in the equation, likewise for $y$. If the result, after doing so, is not an equality, then the third point doesn't "satisfy" the equation; in other words, it is therefore not on the line.

If $(-1,8)$ does not satisfy the equation of the line (such that after replacing $x$ and $y$ with the third point's coordinates, the two sides of the equation don't match, try using $(-1,-8)$, and if that works, you need to recheck the method you used to obtain the point $(-1,8)$.

Of course, you can also use the slope-intercept form, after computing the slope, as above: $$y = mx + b$$ To solve for $b$, the $y$-intercept, simply evaluate the equation, putting $x = 0.$ That should give you $y = b$ (at $x = 0$): the point at which the line intersects the $y$-axis.

Caveat:

Now, suppose $x_1 = x_2$. Then what? We certainly cannot use the general two-point formulation given above, since if $x_1=x_2$, then $x_2 - x_1 = 0$, and division by zero is undefined. What do you know about lines for which the slope is undefined?

Such lines are always vertical lines, perpendicular to the $x$-axis, so every $x$-coordinate on such a line is identical. If we can rewrite the equation provided above in (1) as such:

$$(x_2 - x_1)(y - y_1) = (y_2 - y_1)(x-x_1)$$

The left side evaluates to $0$; simplifying gives us the equation $x = x_1.$

Recommendation: if this question is related to your studying for exams etc., it's important to understand how to compute the equation of a line, given two points, given the slope, and also how to easily move back and forth between such forms.

  • 0
    @Amy: Just to make it complete, you might want to say a word or two of what to do when $x_2=x_1$.2011-05-10
  • 0
    Ah...good point, Arturo!2011-05-10
  • 0
    Thank you very much for breaking that down for me!!! :)2011-05-11
  • 0
    I had a few votes to spare today and thought it would reduce the reviewing work drastically if I voted you over the threshold of 2k rep. Now you can edit as much as you want and the edits take immediate effect... Have fun! I honestly tried to choose answers I really like, so I don't think the votes are undeserved.2011-05-29
  • 0
    Of course, I didn't mean to imply that there were answers I didn't like... I hope you got my meaning.2011-05-29
  • 0
    @Theo: Thanks! I've been worried that with all my editing, I've been a "pain in the arse" to those who needed to "review" and approve my edits...! Now, no worries!2011-05-29
  • 0
    Actually, no, not at all! One can always choose to ignore the suggested edits (it's just a small (0) that shows up next to the edit link). Yours were usually good and entirely justified and I rarely felt I needed to improve on them. As far as I recall I only rejected one or two of yours - there are other people where one really needs to look *very* closely and *that's* a "pain in the posterior".2011-05-29
  • 0
    @Theo: Thanks, again! I think, actually, that only 3, maybe 4 of my edits were rejected/not-accepted, and one because I was editing while another good edit was posted, which was perfectly appropriate. I'm going to have to restrain myself a little, since it can be very time consuming for some posts, especially those which stand a good chance of being closed, anyway. This has actually been great practice with LaTeX, which I knew very little of prior to interacting with this site, so in that sense, editing has **really** been good practice!2011-05-29
  • 0
    Yes, this site has definitely a lot of ways to indulge in time consuming habits...If you're thinking about writing some of your stuff in LaTeX in the future, I strongly recommend printing out and reading (at least) the first three chapters of [Tobi Oetiker](http://tobi.oetiker.ch/hp/)'s *[The not so short introduction to LaTeX](http://tobi.oetiker.ch/lshort/)*. I saw that you align a lot of stuff manually, that's a bit against the philosophy of Knuth and it is better to let LaTeX take care of that, especially in longer documents.2011-05-29
  • 0
    Thanks, @Theo. I think I've got your link bookmarked; I'll be sure to print it. It would be good, now that I've got some "concrete" experience and motivation, t!o learn more LaTeX in a more systematic way. I type up all my work, but until now, (I'm ashamed to confess) I've resorted to Microsoft Office symbols and equation editor! Talk about tedious! So much so it almost has driven me mad! I'll be sure to read up on alignments, et. al., at the very least! Question: would knowing html inside out help with LaTeX, as well (i.e., does LaTeX adopt some standard formatting from html, e.g.?)2011-05-29
  • 0
    No, not really. That's only the case here where MathJaX is the link between html and LaTeX. Of course, if you know raw html then you'll certainly note some similarity: First and foremost you care about the *semantics* of your document and let LaTeX (or in the case of html CSS nowadays) take care of the formatting. On the other hand LaTeX is much more powerful (also older) than html and I'm not aware of a way of including html in a LaTeX document (but I never looked for something like that). The learning curve for LaTeX is a bit steep but you'll not notice as you already know the basics.....2011-05-29
  • 0
    ...but as soon as you have a good system running on your machine and have two or three documents completed in LaTeX you'll sure look back and wonder how you *ever* managed to have the nerves to deal with MS office and it's symbols and equation editor. A friend of mine once said that WYSIWYG a la MS Office should be called what you see is what you don't want :)2011-05-29
  • 0
    By the way: There are people who don't like the fact that LaTeX isn't WYSIWYG. Some friends of mine thus swear on [Scientific WorkPlace](http://en.wikipedia.org/wiki/Scientific_WorkPlace), but I never tried it myself.2011-05-29
  • 0
    @amWhy: Nice answer! +12013-05-17
8

For 3 points to be collinear:

The area of the triangle formed by given 3 points should be ZERO.

Suppose there are three points given A(x1, y1), B(x2, y2) and C(x3, y3). Then

                     x1 y1 1
Area(ABC) = (1/2)det x2 y2 1
                     x3 y3 1

Where det is determinant. So find this determinant, if zero, the given points are collinear otherwise not.

For n points to be collinear:

Input: P1, P2, P3, ... , Pn

Method 1:

  1. For each triplet (P1, P2, P3)
  2. See if these three are collinear using area of the triangle method given above.
  3. Repeat for (P3, P4, P5) and so on till (Pn-2, Pn-1, Pn)
  4. If all triplets are collinear (area = zero) then given n points are collinear.

Method 2:

  1. Find minimum and maximum points with respect to x-coordinate.
  2. Find equation of the line joining these min and max points using two-point formula (credit: amWhy).
  3. For each remaining n-2 points, check whether they all lie (satisfy the equation) on this line.

Food for thought: If you want to find 3 collinear points from given n points then it's rather tough and time complexity is more.

Thanks.

8

Here are three tests of collinearity.

Distance Test

This is the first test I learned to check if three points were collinear. It actually tests if one point is between two others. Given three points $(x_1,y_1)$, $(x_2,y_2)$, and $(x_3,y_3)$, the point $(x_2,y_2)$ is between $(x_1,y_1)$ and $(x_3,y_3)$ when $$ |(x_1,y_1)-(x_3,y_3)|=|(x_1,y_1)-(x_2,y_2)|+|(x_2,y_2)-(x_3,y_3)| $$ If any of the three points is between the other two, they are collinear; that is, if any of the distances is the sum of the other two.

$\hspace{3cm}$enter image description here

Area Test

The area of a triangle is given by half the determinant of the vectors of two of the sides. That is, given

$\hspace{4cm}$enter image description here

The area of the triangle is $$ \frac12\det\begin{bmatrix}x_2-x_1&y_2-y_1\\\\x_3-x_1&y_3-y_1\end{bmatrix} $$ The three points are collinear exactly when this area is $0$.

Volume Test

Given three points in $\mathbb{R}^2$, first we move them into $\mathbb{R}^3$, $z=1$ to be precise. Next the volume of the tetrahedron formed by three points and the origin is one sixth the determinant of the three points.

That is, the volume of

$\hspace{3cm}$enter image description here

is $$ \frac16\det\begin{bmatrix}x_1&y_1&1\\x_2&y_2&1\\x_3&y_3&1\end{bmatrix} $$

The volume of a pyramid is one third of the base times the altitude. In the case above, the altitude is $1$. Thus, the points are collinear exactly when this volume is $0$.

  • 0
    isn't there another technique like the following: To test whether $ \frac {x_2-x_1} {\delta x}$ and $ \frac {y_2 - y_1} {\delta y} $ are equal?2015-08-02
  • 1
    What you are suggesting is essentially the area test, since the determinant is zero precisely when $$(x_2-x_1)(y_3-y_1)=(x_3-x_1)(y_2-y_1)$$ which is equivalent to $$\frac{y_3-y_1}{x_3-x_1}=\frac{y_2-y_1}{x_2-x_1}$$2015-08-02
  • 0
    Oh. Thanks for the clarification.2015-08-02
  • 0
    I just discovered that, area test doesn't work for line segments.2015-08-03
  • 0
    I am not sure I understand what you are saying. For what line segment does it not work?2015-08-03
  • 0
    Suppose P(x1, y1)=(1,1), Q(x2, y2)=(1,20) and R(1,6). Now, we want to test if Q lies on PR or not. Then, in this case area test fails. Q is collinear to P and R. But, it doesn't lie on PR line segment.2015-08-03
  • 0
    But $Q$ lies on the line containing $P$ and $R$.2015-08-03
  • 0
    I told you about line segment dilimited by P and R. Not, line extended to infinity of both sides of PR. So, in this case, I think, distance test is the only option.2015-08-03
  • 0
    The test was for whether three points were collinear, not whether one particular point is between two others. That is why the distance test needs to be checked to see if any of the points is between the other two.2015-08-03
  • 0
    So, as it stands, area test and volume test do not give correct results all times. But, distance test does.2015-08-03
  • 0
    Why do you say that those tests do not give the correct result? They all say that those three points are collinear (that is, they all lie on the same line), and they are.2015-08-03
  • 0
    Actually, I am working with line segments. Since it works only for lines, not line segments, it is not safe to use.2015-08-03
  • 0
    What do you mean? If you want to find out if a point is between two others, you should use a test for that, not a test to see whether the points are collinear. Saying that $Q$ is between $P$ and $R$ is not the same as saying $P$, $Q$, and $R$ are collinear.2015-08-03
  • 0
    Yes. I know. I suppose, distance test can be used both in collinear+inside line-segment, and, collinear+outside line-segment.2015-08-03
  • 0
    @anonymous: yes, the "Distance Test" will tell whether a given point is between two others.2015-08-03
2

For three to be collinear, the sum of the distance between two pairs of points equals the distance between the third pair of points (ie .|AB|+|AC|=|BC| or |AB|+|BC|=|AC| or |AC|+|BC|=|AB|

1

(upps: didn't notice the date of the original posting (it's one year old) But now that I've written so much I just leave it here for the cursory reader)

A very elementary method is the following (which is in effect just Arturo Magidin's formula made geometrically explicite).

Assume your three points in a matrix $$\small A=\begin{bmatrix} 1&2&7 \\ 4&7&22 \end{bmatrix} = \begin{bmatrix} x_1&x_2&x_3 \\ y_1&y_2&y_3 \end{bmatrix}$$ where the first row shows the coordinates on the x-axis and the second row that of the y-axis. We might imagine a triangle on the plane.

First we drag that triangle vertically, such that the first point lies on the x-axis , that means, we subtract from all y-coordinates that of the first point. We get $$\small A_1=\begin{bmatrix} 1&2&7 \\ 0&3&18 \end{bmatrix} \qquad \qquad (=A- \begin{bmatrix} .&.&. \\ 4&4&4 \end{bmatrix})$$ Then we drag that triangle horizontally, such that the second point lies on the y-axis, that means, we subtract from all x-coordinates that of the second point. We get $$\small A_2=\begin{bmatrix} -1&0&5 \\ 0&3&18 \end{bmatrix} \qquad \qquad (=A_1- \begin{bmatrix} 2&2&2\\.&.&. \end{bmatrix})$$ Now we can imagine a diagonal line from (-1,0) to (0,3) and the third point must lie on that line. Without changing the configuration of the triangle we might scale the x and the y-extensions for convenience, such that the first x-coordinate is -1 and the second y-coordinate is +1, so we divide the y-xoordinates by 3, and even can leave the x-coordinates untouched: $$\small A_3=\begin{bmatrix} -1&0&5 \\ 0&1&6 \end{bmatrix} $$ Now the first four coordinates define the diagonal line with slope 1 through (-1,0) and (0,1) and each collinear point must have $\small y_k=1+x_k$ or $\small y_k-x_k=1$. We see that this is true immediately, but we can also subtract the x-coordinates from the y-coordinates to make it explicite: $$\small A_4=\begin{bmatrix} 0&0&0 \\ 1&1&1 \end{bmatrix} $$ which shows then collinearity of our three points.


Another example which is not collinear is $$\small B=\begin{bmatrix} 1&2&3 \\ 4&7&5 \end{bmatrix} $$ We translate to $\small x_2=0, y_1=0$ $$\small B_2=B-\begin{bmatrix} 2&2&2 \\ 4&4&4 \end{bmatrix}=\begin{bmatrix} -1&0&1 \\ 0&3&1 \end{bmatrix} $$ We rescale to $\small x_1=-1, y_2=1$ $$\small B_3= \begin{bmatrix} 1 \\ \frac13\end{bmatrix} \cdot B_2=\begin{bmatrix} -1&0&1 \\ 0&1& \frac13 \end{bmatrix} $$ and immediately we see by the difference $\small x_3-y_3 \ne 1$ that the third point is not collinear with the other two points.