summaryrefslogtreecommitdiff
path: root/libgeometry/triangle.c
blob: a8bbf0ffb87fcfd7cc2328ed41e2956502b6f1c9 (plain)
1
2
3
4
5
6
7
8
9
#include <u.h>
#include <libc.h>
#include "../geometry.h"

Point3
centroid(Triangle3 t)
{
	return divpt3(addpt3(t.p0, addpt3(t.p1, t.p2)), 3);
}