diff options
author | rgl <devnull@localhost> | 2020-02-03 22:42:28 +0100 |
---|---|---|
committer | rgl <devnull@localhost> | 2020-02-03 22:42:28 +0100 |
commit | 0373255087377122eeb10e006ffb8aa1b57e611c (patch) | |
tree | 33a4fafa4996fc2efa205b2973622c3fbd27f368 /libgeometry/triangle.c | |
download | 3dee-0373255087377122eeb10e006ffb8aa1b57e611c.tar.gz 3dee-0373255087377122eeb10e006ffb8aa1b57e611c.tar.bz2 3dee-0373255087377122eeb10e006ffb8aa1b57e611c.zip |
after a year or so of work, i dare create a proper repo.
Diffstat (limited to 'libgeometry/triangle.c')
-rw-r--r-- | libgeometry/triangle.c | 9 |
1 files changed, 9 insertions, 0 deletions
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 <u.h> +#include <libc.h> +#include "../geometry.h" + +Point3 +centroid(Triangle3 t) +{ + return divpt3(addpt3(t.p0, addpt3(t.p1, t.p2)), 3); +} |