module exports

This commit is contained in:
2023-11-05 02:04:18 -07:00
parent ea311a1787
commit 69ab471d22
3 changed files with 204 additions and 180 deletions

View File

@@ -20,6 +20,8 @@ export class Polygon {
color,
});
}
doodler.dot(this.center, { weight: 4, color: "yellow" });
}
calcCenter() {
@@ -103,6 +105,9 @@ export class Polygon {
poly.points.push(pt);
}
poly.center = poly.calcCenter();
for (const p of poly.points) {
p.sub(poly.center);
}
return poly;
}