2/20/11

Ceva's theorem vector proof

Let ABC be a triangle and suppose that P divides BC in the ratio 1 : s and that Q divides CA in the ratio 1 : t and that R divides AB in the ratio 1 : u. Then AP, BQ and CR are concurrent if and only if stu = 1.
Proof:
We can write the line through the points A and P in a parametric form with parameter alpha:
Similarly, we can write the line through the points B and Q in a parametric form with parameter beta:
Since the expressions are in the triangle coordinate form - 
their coefficients will be equal at their point of intersection, thus we can equate coefficients of A and B, then solve for aplha and beta:






 Similarly we work out coefficients of B and C to get:
 [1]

Now we can avoid doing whole procedure again by cyclically permuting all the quantities involved. Hence we get:
    [2]


Expressions [1], [2] are equal if and only if stu=1.

2/18/11

finding the shortest distance from point to a line segment

Suppose line segment is defined by two points A and B. Let C be another point. Our goal is to compute the shortest distance from point C to line segment AB.
First, let’s write the parametric equation for the line going through the points A and B:
Let P be the point on the line L and let’s assume that C-P is the shortest distance from C to L:
         
So the magnitude of C-P is:

Since we are looking for the shortest distance we shall find the derivative of |C-P| as a function of t, then seek for the minimum:


thus we can find t:

So now we have projection P of point C on the line L. If P is on the line segment AB then |C-P| is the distance we are looking for, else the distance is min{ |CA|, |CB| }.


The most trivial way to check if point P is on the line segment AB is to check if |AB|=|AP|+|PB|.