Results 1 to 4 of 4

Math Help - Centroid of a Quadrilateral?

  1. #1
    Newbie
    Joined
    Apr 2009
    Posts
    2

    Centroid of a Quadrilateral?

    Hi,

    I am writing a program where I need to work out the centroid of a quadrilateral given the coordinates of its 4 corners. I know this can be done graphically quite easily but I was wondering if there is a formula I can use to code it?

    Advanced Thanks.

    Mark.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Dec 2007
    From
    Ottawa, Canada
    Posts
    3,102
    Thanks
    68
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor

    Joined
    Apr 2005
    Posts
    15,583
    Thanks
    1418
    Here's one way to do it: draw either of the diagonals, dividing the quadrilateral into two triangles. Triangles have the nice property that the centroid of a triangle is the average of the three vertices- that is, add each the x coordinates of the three triangles, the y coordinates, and the z coordinates (if this is in three dimensions) and divide by three. Those three averages will be the x, y, and z coordinates of the centroid of the triangle.

    Once you have the centroids of the two triangles, the centroid of the quadrilateral is the weighted average of the two points, weighted by the area of the triangles. That is, if P_1= (x_1, y_1, z_1) and A_1 are the centroid and area, respectively, of the first triangle, and P_2= (x_2, y_2, z_2) and A_2 of the second triangle, then the centroid of the quadrilateral is \frac{A_1P_1+ A_2P+2}{A_1+ A_2} = \left(\frac{A_1x_1+ A_2x_2}{A_1+ A_2}, \frac{A_1y_1+ A_2y_2}{A_1+ A_2}, \frac{A_1z_1+ A_2z_2}{A_1+ A_2}\right)
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Jun 2013
    From
    Amsterdam
    Posts
    1

    Re: Centroid of a Quadrilateral?

    What a pity HallsofIvy, you almost had a beautiful answer. The weighing is not necessary, just divide the quadrilateral by one of its two diagonals like you suggested and connect the centers of gravity of both resulting triangles, i.e. their centroids, and repeat the procedure with the OTHER diagonal of the quadrilateral. The intersection of both connectors of centers of gravity must be the center of gravity of the Quadrilateral!
    Last edited by Bloggerheads; June 22nd 2013 at 01:33 PM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Centroid Help!
    Posted in the Calculus Forum
    Replies: 2
    Last Post: April 24th 2009, 03:30 PM
  2. Centroid
    Posted in the Calculus Forum
    Replies: 6
    Last Post: November 3rd 2008, 01:56 PM
  3. Centroid
    Posted in the Calculus Forum
    Replies: 0
    Last Post: October 19th 2008, 05:08 PM
  4. Centroid
    Posted in the Calculus Forum
    Replies: 9
    Last Post: March 18th 2008, 10:44 AM
  5. Centroid help
    Posted in the Calculus Forum
    Replies: 2
    Last Post: March 6th 2008, 12:52 PM

Search Tags


/mathhelpforum @mathhelpforum