move: implement circle movement

This commit is contained in:
2026-08-05 20:49:53 +02:00
parent 8032bdd31a
commit 0136981551
3 changed files with 83 additions and 48 deletions
+4
View File
@@ -13,6 +13,10 @@ export default class Vec2d implements Point {
this.y = y;
}
static fromPolar(r: number, theta: number) {
return new Vec2d(r * Math.cos(theta), r * Math.sin(theta));
}
static random(maxX: number, maxY: number) {
return new Vec2d(Math.random() * maxX, Math.random() * maxY);
}