In all that follows we assume an X-axis orthogonal to a
Y-axis fixed in o and so that the unities on both axes have the same
magnitude. We call this : 'orthonormal axes'.
We know that, in a plane, each line l has an equation of the
form
ax+by+c=0
If b is not 0, the slope of that line is -a/b . Remark: ax+by = 0 is
the equation of a line parallel to l and containing the origin o.
Let line l : ax+by+c=0 and l' : ax+by = 0 Each point P on
l' is the image point of a vector P defining the direction of l. Then,
P is called a direction vector of l. If r is a real number (not 0 ) ,
then r.P is a direction vector too. A simple choice for P is
P(b,-a).
Say that a line l has equation ax+by+c=0 . Three points
P(x1,y1) Q(x2,y2) and
R(x3,y3) are on line l if and only if
a x1 + b y1 + c = 0
a x2 + b y2 + c = 0
a x3 + b y3 + c = 0
From the theory of homogenious systems of linear equations, we know that
previous system has a solution for a,b and c if and only if
|x1 y1 1|
|x2 y2 1| = 0
|x3 y3 1|
Conclusion :
Three points P(x1,y1)
Q(x2,y2) and R(x3,y3) are on
line l if and only if
|x1 y1 1|
|x2 y2 1| = 0
|x3 y3 1|
|
From above we know that a variable
point D(x,y) is on the line PQ if and only if
|x y 1|
|x1 y1 1| = 0
|x2 y2 1|
So, this is the equation of the line PQ.
The line PQ with P(x1,y1) and
Q(x2,y2) is
|x y 1|
|x1 y1 1| = 0
|x2 y2 1|
|
These topics are in the covered in Lines - orthogonality and distances
The distance |Q,R| =
___________________________
|
\| (x2 - x3)2 + (y2 - y3)2
From above, the equation of the line QR is
|x y 1|
|x2 y2 1| = 0
|x3 y3 1|
If we calculate this determinant emanating from the first row, we find
x(y2 - y3) - y(x2-x3) + x2 y3 - x3 y2 = 0
To calculate the distance from P to the line QR, we write first the normal
equation of a line QR
x(y2 - y3) - y(x2 - x3) + x2 y3 - x3 y2
--------------------------------------- = 0
_________________________
|
\| (x2 - x3)2 - (y2 - y3)2
<=>
|x y 1|
|x2 y2 1|
|x3 y3 1|
--------------------------------------- = 0
___________________________
|
\| (x2 - x3)2 - (y2 - y3)2
Now, to find the distance, we have to take the absolute value of the left
side and we must replace x and y by the coordinates of P. The distance from P to
QR is
|x1 y1 1|
|x2 y2 1|
|x3 y3 1|
| -------------------------------- |
_________________________
|
\| (x2 - x3)2 - (y2 - y3)2
The area of the triangle P(x1,y1)
Q(x2,y2) and R(x3,y3) is
|x1 y1 1|
_________________________ |x2 y2 1|
1 | |x3 y3 1|
- . \| (x2 - x3)2 + (y2 - y3)2 | -------------------------------- |
2 _________________________
|
\| (x2 - x3)2 - (y2 - y3)2
<=>
1 |x1 y1 1|
-.| |x2 y2 1| |
2 |x3 y3 1|
This is a very simple formule to calculate the area of a triangle.
The area of the triangle P(x1,y1)
Q(x2,y2) and R(x3,y3) is
1 |x1 y1 1|
-.| |x2 y2 1| |
2 |x3 y3 1|
| |