Rating:

The area of the triangle created from 3 vertices in 3-space can be calculated using vectors. The area of a triangle with vertices at A, B, and C in 3-space can be calculated with the equation

![](https://chart.googleapis.com/chart?cht=tx&chl=area%20%3D%20\frac{1}{2}||\vec{AB}%20\times%20\vec{AC}||)

where ![](https://chart.googleapis.com/chart?cht=tx&chl=\vec{AB}) is the vector from vertex A to B, ![](https://chart.googleapis.com/chart?cht=tx&chl=\vec{AC}) is the vector from A to C, and ![](https://chart.googleapis.com/chart?cht=tx&chl=\|\|\vec{AB}%20\times%20\vec{AC}\|\|) is the norm of the cross product of vectors AB and AC. We perform this calculation for all 3 vertex combinations in the given coordinates, and return the largest area found. [triangle.py](https://gitlab.com/malcrypt/ctf-archive/-/blob/master/2021/tenable/code/triangle/triangle.py) implements this solution.

Original writeup (https://malcrypt.gitlab.io/blog/ctfs/2021/tenable/code/triangle/).