From 0373255087377122eeb10e006ffb8aa1b57e611c Mon Sep 17 00:00:00 2001 From: rgl Date: Mon, 3 Feb 2020 22:42:28 +0100 Subject: after a year or so of work, i dare create a proper repo. --- libgeometry/triangle.c | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 libgeometry/triangle.c (limited to 'libgeometry/triangle.c') diff --git a/libgeometry/triangle.c b/libgeometry/triangle.c new file mode 100644 index 0000000..a8bbf0f --- /dev/null +++ b/libgeometry/triangle.c @@ -0,0 +1,9 @@ +#include +#include +#include "../geometry.h" + +Point3 +centroid(Triangle3 t) +{ + return divpt3(addpt3(t.p0, addpt3(t.p1, t.p2)), 3); +} -- cgit v1.2.3