# How do you calculate the area of a 2D polygon in 3D? [closed]

How can I calculate the surface area of a set of coplanar points, representing the vertices of a polygon, in three dimensions?

Should I convert it into 2D, or is there a way to compute this quantity in 3D?

• Are the vertices coplanar ? Commented Apr 30, 2019 at 8:19
• @JeanMarie yes, they are Commented Apr 30, 2019 at 8:24
• Let's say your vertices are $\vec{v}_1, \vec{v}_2, \ldots, \vec{v}_n$. Let $\vec{v}_0 = \vec{v}_n$. Compute the sum of cross products $$\vec{A} = \frac12 \sum_{k=1}^n \vec{v}_k \times \vec{v}_{k-1}$$ If the vertices are coplanar, then it has area $|\vec{A}|$ Commented Apr 30, 2019 at 8:26
• @achille hui One has to be careful : vertices $A_k$ can be coplanar without the $v_k=\vec{OA_k}$ being so. Thus taking the norm at the end instead of taking it every time will not work. Example with $A_1(1,1,1),A_2(1,-1,1),A_3(-1,-1,1),A_4(-1,1,1)$. Commented Apr 30, 2019 at 8:59
• @JeanMarie the formula doesn't assume $\vec{v}_k = \vec{OA}_k$ to be coplanar. If you replace $\vec{v}_k$ by $\vec{PA}_k$ for any reference point $P$, the $P$ dependent part of the sum cancel out. In fact, you should not take the norm before the sum. The formula for sum of individual area can fail if the reference point is outside the polygon or when the polygon is non-convex. Commented Apr 30, 2019 at 9:09

You don't have to come back to a 2D framework.

Let $$O=\dfrac1n \sum A_k$$ be the center of gravity of your cloud of points. It belongs naturally to their common plane.

The area of triangle $$OA_kA_{k+1}$$ is

$$\dfrac12\|\vec{OA_k} \times \vec{OA_{k+1}}\|$$

(half the norm of the cross product : https://en.wikipedia.org/wiki/Cross_product).

But, after discussion with @achille hui (that I thank very much for this remark), sum all these vectors and take their norm at the end.

$$area =\left\| \sum_{k=1}^{k=n}\dfrac12\vec{OA_k} \times \vec{OA_{k+1}} \right\| \tag{1}$$

(we assume cyclicity, i.e., $$A_{n+1}=A_1$$)

The benefit of taking norm at the end instead of taking it each time is that you can cope in this way with non-convex polygons.

Remark : A simpler formula : instead of taking the center of gravity $$O$$, one can take for example $$A_1$$ as the reference point. In this case, the two terms containing $$\vec{OA_1}$$ vanish, transforming the sum with $$n+1$$ terms into the following sum containing $$n-1$$ terms only:

$$area =\left\| \sum_{k=2}^{k=n-1} \dfrac12\vec{A_1A_k} \times \vec{A_1A_{k+1}} \right\| \tag{2}$$

Explanation : Let $$\vec{N}$$ be a normal unit vector to the plane of the $$A_k$$. Let us assume first that the set of vertices $$A_k$$ is convex. When "traversing" it, we will have

$$\dfrac12\vec{OA_k} \times \vec{OA_{k+1}}=a_k\vec{N}$$

with $$a_k$$ the signed area of triangle $$OA_kA_{k+1}$$

If we assumed that $$\vec{N}$$ is oriented such that all $$a_k \geq 0$$, this explains the result. But the "miracle" is that, if the polygon generated by the $$A_k$$ isn't convex, some of the $$a_k$$s will become negative, but it will not entail the result because there willl be areas concellations.

Edit: Formula (2) can be extended not only to non-convex polygons but as well to certain self-crossing polygons. For example in the following case, formula (2) gives the following sum $$2-3+2=1$$ which is equal to the sum $$+2-1=-1$$ of oriented areas of the upper square (area $$+2$$) and area of right triangle at the bottom which is $$-1$$.

In fact all this is well descibed under the "shoelace formula" terminology here.

• In fact the choice of the reference point doesn't matter, so one can simply use the origin as in achille hui's comment. That said, your choices probably gives better numerical stability.
– user856
Commented Apr 30, 2019 at 8:46
• @Rahul : after an exchange with achille hui, you and him are perfectly right : $O$ doesn't need to belong to the same plane as the vertices. Commented Apr 30, 2019 at 9:33
• $O=A_1$ would work as well. Commented Apr 30, 2019 at 10:00
• @CiaPan It is what I have given as a remark. Taking at first another origin has only a pedagogical interest. Commented Apr 30, 2019 at 10:06
• @Connor : see the edit I just added. Commented Mar 11, 2022 at 20:58