module exports
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user