Area of a triangle in 3D space

It can be very helpful to know how to calculate the area of triangles in 3D space. You can use it to calculate the surface area of an object, which in turn you can use to calculate/set mass or density of objects.  Primarily, I use area to create distribution attributes for particle emission, such that polygons of varying size emit a spatially consistent amount of particles.  For example, in Houdini, if area is assigned as a primitive attribute (you have measured the area of each polygon and stored it) you simply multiply area by emission rate and will get a fairly even distribution of particles emitted from a surface.  Of course, Houdini has a built in operator to calculate area, but if you don’t have such an operator in your 3D program, or you are writing your own code, here’s how to do it.

The main tools needed to calculate an area of a triangle in 3D space are covered in my post about distance.

The basic formula using vectors goes something like this:

Given three vector points in space, A, B, and C, the area of the triangle formed by those points is 1/2 the magnitude (see distance) of the cross product (see cross product) of vector AB and AC.

It can be written in mathematical notation like this:

1/2 * |AB x AC|

It can also be explained diagrammatically like so:

So, given three points, A, B, and C, pick one point arbitrarily and calculate two distance vectors between that point and the other two points (distance vectors AB and AC) by doing vector subtraction.  Find the cross product between those vectors.  The cross product outputs a vector.  Now, calculate the magnitude of this vector, and finally divide by 2 (or multiply by 0.5).