snake: add catmull-rom rendering mode

This commit is contained in:
2026-08-15 15:44:59 +02:00
parent 3a58f98acf
commit db3aabc03e
3 changed files with 34 additions and 20 deletions
+4
View File
@@ -13,6 +13,10 @@ export default class Vec2d implements Point {
this.y = y;
}
static fromPoint(p: Point) {
return new Vec2d(p.x, p.y);
}
static fromPolar(r: number, theta: number) {
return new Vec2d(r * Math.cos(theta), r * Math.sin(theta));
}