In the previous post we worked through the calculation of the centroid of an isosceles triangle. In this post we delve into the calculation of the centroid of an arbitrary triangle.
Not this post is pretty much a "slower" version of the content of this great video, here.
Triangle consisting of 3 points: a, b, and c
Consider a triangle consisting of points a, b and c.
And here is the first trick to making the calculations more manageable. Imagine that the points are defined with reference to a special frame of reference local to this triangle, with axes u-axis, and v-axis, which are in fact parallel with a->b and a->c. Imagine also that the origin is a, and b is 1 unit along the u-axis + 0 along the v-axis, and c is at 0 along the u-axis and 1 along the v-axis.
The centroid of this triangle would be given by:
where:
r is the vector pointing to dA from the origin (which we have taken to be vertex a)
A is the total area of the triangle
r can of course be expressed as being some units (scalar u) along axis u and some units (scalar v) along axis v.
where:
how can we define dA?
Imagine the parallelogram as follows. You will note that dA would be directly proportional to the area of the parallelogram, which is 2A (twice the area of the triangle)
Hence, we can say that:
Substituting this into the centroid formula above then gives us:
Replacing r with a column vector of u and v then gives:
Then something called Green's theorem can be used to transform the above integral over an area (i.e. over the area of the triangle) to an integral over a line (specifically, the outline of the triangle - from vertex a to vertex b to vertex c), which is slightly easier to solve.
Green's Therem
Wiki says:
Let C be a positively oriented, piecewise smooth, simple closed curve in a plane, and let D be the region bounded by C. If L and M are functions of (x, y) defined on an open region containing D and have continuous partial derivatives there, then
What we want to do is to convert our centroid integral from the right part of the Green's theorem to the left part of the Green's theorem (think of the x as our u, and y as our v), like so:
We are now required to perform an integral along the path a->b->c. Thinking through this element by element:
Path a->b: We are moving along axis u with v = 0. By definition dv is also 0. Hence the bit inside the bracket in the above integral is zero.
Similarly, Path a->c (or strictly speaking, path c->a) is zero for similar reasons.
So, we just need to think about the integral along path b->c.
We noted earlier that any point on the triangle can be expressed as a linear function of u and v where the coefficients u+v = 1. It follows that du = -dv. Hence:
We can make this even simpler by flipping the u-axis "upside down" and getting rid of the minus in the column matrix.
Geometrically, u+v is the vertex at the "other end" of the parallelogram, as below. Hence the above formula is saying that the centroid is a third of the way along the vector shown.
By replacing u and v by the vertices, adding vertex a (which has been assumed to be the origin in the above calculation) gives us:
A remarkably simple result.
Comentários