If you have an equilateral triangle in 3D space, where all the sides are of length 1, there are two points that you could use to form a tetrahedron. One floating out in front of the triangle, and one behind it. Given the coordinates of the three known vertices, how would you calculate either of the possible fourth vertices?
I would really appreciate it if you can show how to do it with the Processing vector class definition
Average your three points to get the center of the triangle:
Calculate the normal vector by taking the cross product of two of the sides:
Normalize the normal vector (make it of unit length):
Scale the normal by the height of regular tetrahedron:
Now, your two points are: