The Math Forum

Ask Dr. Math - Questions and Answers from our Archives
Associated Topics || Dr. Math Home || Search Dr. Math

Point on a Line

Date: 03/23/2001 at 01:30:02
From: Chris
Subject: Point exists on line?

Can you please tell me a formula to find if a point exists on a line?
Both are in x,y form.

Example: is point (x3,y3) on line (x1,y1) - (x2,y2) ?

Thank you.

Date: 03/23/2001 at 05:31:00
From: Doctor Floor
Subject: Re: Point exists on line?

Hi, Chris,

Thanks for writing.

We can check whether the slopes of the lines through 
  * P1(x1,y1) and P2(x2,y2) 
  * P1(x1,y1) and P3(x3,y3)
are equal.

The first slope is given by

   y1 - y2
   x1 - x2

and the second slope is given by

   y1 - y3
   x1 - x3

The condition that these two are equal gives:

   y1 - y2    y1 - y3
   ------- =  -------
   x1 - x2    x1 - x3

and thus

  (y1 - y2)(x1 - x3) = (y1 - y3)(x1 - x2)

  x1y1 + x3y2 - x1y2 - x3y1 = x1y1 + x2y3 - x1y3 - x2y1

  x1(y3-y2) + x2(y1-y3) + x3(y2-y1) = 0

This is the formula you are looking for.


The left-hand side of the equation can be written in the form of a 

 | 1  x1  y1 |
 | 1  x2  y2 | = 0
 | 1  x3  y3 |

(The column of 1's can also be the last column.)

This determinant is a very special one: it is the expression for twice 
the area of triangle P1P2P3. So the condition that P3 lies on line P1 
and P2 is translated into the condition that triangle P1P2P3 has an 
area of zero.

For information on the determinant, see, from the Dr. Math archives,

  Determinants and the Area of a Triangle   

  Finding Area Using Determinants   
If you need more help, just write back.

Best regards,
- Doctor Floor, The Math Forum   
Associated Topics:
High School Basic Algebra
High School Equations, Graphs, Translations
High School Linear Equations

Search the Dr. Math Library:

Find items containing (put spaces between keywords):
Click only once for faster results:

[ Choose "whole words" when searching for a word like age.]

all keywords, in any order at least one, that exact phrase
parts of words whole words

Submit your own question to Dr. Math

[Privacy Policy] [Terms of Use]

Math Forum Home || Math Library || Quick Reference || Math Forum Search

Ask Dr. MathTM
© 1994- The Math Forum at NCTM. All rights reserved.