Distance formula: Difference between revisions
No edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
{{stub}} | {{stub}} | ||
Shortest distance from a point to a line: | |||
the distance | |||
between the line <math>ax+by+c = 0</math> and point <math>(x_1,y_1)</math> is | |||
<math>|ax_1+by_1+c|/\sqrt(a^2+b^2)</math> | |||
Proof: | |||
The equation <math>ax + by + c = 0</math> can be written: | |||
<math>y = -(a/b)x - (c/a)</math> | |||
So the perpendicular line through (x1,y1) is: | |||
<math>x-x_1</math> <math>y-y_1</math> | |||
---- = ---- = <math>t/\sqrt(a^2+b^2)</math> where t is a parameter. | |||
a b | |||
t will be the distance from the point <math>(x_1,y_1)</math> along the perpendicular line to (x,y). | |||
So | |||
<math>x = x_1 + a \dot t/\sqrt(a^2+b^2)</math> | |||
and | |||
<math>y = y_1 + b \dot t/\sqrt(a^2+b^2)</math> | |||
This meets the given line ax+by+c = 0 where: | |||
a(x1+a.t/sqrt(a^2+b^2)) + b(y1+b.t/sqrt(a^2+b^2)) + c = 0 | |||
ax1 + by1 + c + t(a^2+b^2)/sqrt(a^2+b^2) + c = 0 | |||
ax1 + by1 + c + t.sqrt(a^2+b^2) = 0 | |||
so | |||
t.sqrt(a^2+b^2) = -(ax1+by1+c) | |||
t = -(ax1+by1+c)/sqrt(a^2+b^2) | |||
Therefore the perpendicular distance from (x1,y1) to the line | |||
ax+by+c = 0 is: | |||
ax1 + by1 + c | |||
|t| = ------------- | |||
sqrt(a^2+b^2) | |||
Revision as of 11:35, 3 April 2011
The distance formula is a direct application of the Pythagorean Theorem in the setting of a Cartesian coordinate system. In the two-dimensional case, it says that the distance between two points
and
is given by
. In the
-dimensional case, the distance between
and
is
This article is a stub. Help us out by expanding it.
Shortest distance from a point to a line:
the distance
between the line
and point
is
Proof:
The equation
can be written:
So the perpendicular line through (x1,y1) is:
![]()
---- = ---- =
where t is a parameter. a b
t will be the distance from the point
along the perpendicular line to (x,y).
So
and
This meets the given line ax+by+c = 0 where:
a(x1+a.t/sqrt(a^2+b^2)) + b(y1+b.t/sqrt(a^2+b^2)) + c = 0
ax1 + by1 + c + t(a^2+b^2)/sqrt(a^2+b^2) + c = 0
ax1 + by1 + c + t.sqrt(a^2+b^2) = 0
so
t.sqrt(a^2+b^2) = -(ax1+by1+c)
t = -(ax1+by1+c)/sqrt(a^2+b^2)
Therefore the perpendicular distance from (x1,y1) to the line ax+by+c = 0 is:
ax1 + by1 + c
|t| = -------------
sqrt(a^2+b^2)