Tuesday, October 28, 2014

Slope of a Line

Gradient (or slope) of a Line, and Inclination

Application of slope of a line - road gradient
Application: Road sign, indicating a steep gradient.
A 15% road gradient is equivalent to m=0.15.
The gradient (also known as slope) of a line is defined as
gradient=horizontal runvertical rise
In the following triangle, the gradient of the line is given by: ba
right triangle
In general, for the line joining the points (x1, y1) and (x2,y2), we have:
slope of a line diagramWe can now write the fomula for the slope of a line.

Gradient of a Line Formula

We see from the diagram above, that the gradient (usually written m) is given by:
m=x2x1y2y1

Interactive graph - slope of a line

You can explore the concept of slope of a line in the following JSXGraph (it's not a fixed image).
Drag either point A or point B to investigate how the gradient formula works. The numbers will update as you interact with the graph.
Notice what happens to the sign (plus or minus) of the slope when point B is above or below A.
o +
A
B
C
slope m
= rise / run
= 7 / 10
= 0.7
(-9, -4)
(1, 3)
(1, -4)
y2y1
= 3 − -4
= 7
x2x1
= 1 − -9
= 10
5
10
-5
-10
5
-5
x
y
You can move the graph up-down, left-right if you hold down the "Shift" key and then drag the graph.
Sometimes the explanation boxes overlap. It can't be helped!
If you get lost, you can always refresh the page.

Example

Find the slope of the line joining the points (-4, -1) and (2, -5).

Positive and Negative Slopes

In general, a positive slope indicates the value of the dependent variable increases as we go left to right:
graph of line with positive slope
[The dependent variable (usually x) in the above graph is the y-value.]


A negative slope means that the value of the dependent variable (usually y) is decreasing as we go left to right:
graph of line with negative slope

Inclination

graph of inclination
We have a line with slope m and the angle that the line makes with thex-axis is α.
From trigonometry, we recall that the tan of angle α is given by:
tan α=adjacentopposite
Now, since slope is also defined as opposite/adjacent, we have:
graph of inclination
This gives us the result:
tan α = m
Then we can find angle α using
α = arctan m
(That is, α = tan-1 m)
This angle α is called the inclination of the line.

Perpendicular Distance from a Poiint to a Line

Perpendicular Distance from a Point to a Line

(BTW - we don't really need to say 'perpendicular' because the distance from a point to a line always means the shortest distance.)
This is a great problem because it uses all these things that we have learned so far:

The distance from a point (m, n) to the line Ax + By + C = 0 is given by:

d=A2+B2Am+Bn+C
There are some examples using this formula following the proof.

Proof of the Perpendicular Distance Formula

Let's start with the line Ax + By + C = 0 and label it DE. It has slope BA.
straight line graph
We have a point P with coordinates (m, n). We wish to find the perpendicular distance from the point P to the line (that is, distance PQ).
perpendicular to straight line
We now do a trick to make things easier for ourselves (the algebra is really horrible otherwise). We construct a line parallel to DE through (m, n). This line will also have slope BA, since it is parallel to DE. We will call this line FG.
perpendicular and parallel constructions
Now we construct another line parallel to PQ passing through the origin.
This line will have slope AB, because it is perpendicular to DE.
Let's call it line RS. We extend it to the origin (0,0).
We will find the distance RS, which I hope you agree is equal to the distance PQ that we wanted at the start.
perpendicular through origin
Since FG passes through (m, n) and has slope BA, its equation is yn=BA(xm) or y=BAx+Am+Bn.
Line RS has equation y=ABx.
Line FG intersects with line RS when
ABx=BAx+Am+Bn
Solving this gives us
x=A2+B2A(Am+Bn)
So after substituting this back into y=ABx, we find that point R is
(A2+B2A(Am+Bn),A2+B2B(Am+Bn))
Point S is the intersection of the lines y=ABx and Ax + By + C = 0,which can be written y=BAx+C.This occurs when (that is, we are solving them simultaneously)
BAx+C=ABx
Solving for x gives
x=A2+B2AC
Finding y by substituting back into
y=ABx
gives
y=AB(A2+B2AC)=A2+B2BC
So S is the point
(A2+B2AC,A2+B2BC)
The distance RS, using the distance formula, d=(x2x1)2+(y2y1)2 is
d=(A2+B2ACA2+B2A(Am+Bn))2+(A2+B2BCA2+B2B(Am+Bn))2
=(A2+B2)2{A(Am+Bn+C)}2+{B(Am+Bn+C)}2
=(A2+B2)2(A2+B2)(Am+Bn+C)2
=A2+B2(Am+Bn+C)2
=A2+B2Am+Bn+C
The absolute value sign is necessary since distance must be a positive value, and certain combinations of A, m , B, n and C can produce a negative number in the numerator.
So the distance from the point (m, n) to the line Ax + By + C = 0 is given by:
d=A2+B2Am+Bn+C