Centroid of a triangle

3367 days ago by Kris.Coolsaet

We use Gröbner basis techniques to prove that the three medians of a triangle are concurrent. The common intersection point is called the centroid of the triangle.

We may choose the coordinates of the vertices of the triangle to be as follows: \[A: (0,0) \quad B: (b,0) \quad C: (x,y)\] where $b,x,y$ are indeterminate. We denote the intersection of the median through $A$ and the median through $C$ by coordinates $(a,c)$, again with $a,c$ indeterminate.

R = QQ['a,b,c,x,y'] a,b,c,x,y = R.gens() 
       

The above is a shorthand notation for creating a polynomial ring with total degree ordering.

Three points $(x_1,y_1)$, $(x_2,y_2)$, $(x_3,y_3)$ in the plane are collinear if and only if \[\left|\begin{array}{ccc}x_1&y_1&1\\x_2&y_2&1\\x_3&y_3&1\end{array}\right| = 0.\]

def collinear(x_1,y_1,x_2,y_2,x_3,y_3): return matrix ([[x_1,y_1,1],[x_2,y_2,1],[x_3,y_3,1]]).determinant() 
       

The following polynomials are expected to be zero. They express the fact that we know three points on the median through A and three points on the median through C.

medianA = collinear (0,0,a,c,(b+x)/2,y/2) medianC = collinear (x,y,a,c,b/2,0) 
       

And the following polynomial expresses what we want to prove

medianB = collinear (b,0,a,c,x/2,y/2) 
       

Consider the ideal generated by the two assumptions.

I = Ideal(medianA,medianC) G = I.groebner_basis('libsingular:std') 
       

The conclusion should be part of this ideal, i.e., it should reduce to 0 through $G$

medianB.reduce(G) 
       

                                
                            

                                

QED.