Trinity College Dublin
 
Search for: in  
You are here: Home / Category Index / Line Geometry / The Centroid Of A Triangle

The Centroid Of A Triangle - By Cathal Golden

How to use this applet:

Simply click 3 times on the grid to represent the 3 vertices of the triangle. The 3 points will be copied into the relevant textfields. Then click Draw to see a picture of the triangle. The equations of the 3 lines of the triangle will be put into the textarea in the bottom right of the screen. Then press Centroid to see the medians and where they intersect to give the centroid. The midpoints of the lines will be inserted into the relevant textfields. The equations of 2 of the medians will be given in the textarea in the bottom right of the screen. The centroid is then calculated by the point of intersection of these 2 lines and is shown in the relevant textfield. The result of the formula is also shown in the textfield. Any difference will be due to rounding off.

Notes on the maths used in the applet:

The main difficulty in getting the centroid of the triangle lies in getting the equations of the medians. As I have said a median is a line from the midpoint of 1 of the lines of the triangle to the opposing vertex. To find the midpoint we use the formula((x1+x2)/2, (y1+y2)/2) for 2 points (x1,y1) and (x2,y2). once the midpoints have been established the equations of the medians are easily established using the formula y-y1 = m(x-x1) where m is the slope between the 2 lines. Once any 2(or 3) of the medians have been established, the centroid can easily be calculated using simultaneous eqtns. However, there is an easier way of calculating the centroid by using the formula ((x1+x2+x3)/3, (y1+y2+y3)/3) for a triangle with vertices (x1,y1), (x2,y2) and (x3,y3)!

Other useful information:

Does not seem to work in Netscape