Colors. Lines.

This commit is contained in:
2025-12-20 10:58:38 -05:00
parent 3bf2a7b429
commit c9e1eda4d3
4 changed files with 23 additions and 12 deletions

View File

@@ -24,3 +24,8 @@ bool tri_within(Pt pt, Tri* tri) {
double c = 1 - a - b;
return 0 <= a && a <= 1 && 0 <= b && b <= 1 && 0 <= c && c <= 1;
}
Pt tri_center(Tri* tri) {
return (Pt){(tri->a.x + tri->b.x + tri->c.x) / 3.0,
(tri->a.y + tri->b.y + tri->c.y) / 3.0};
}