function rotate(angle: number) { this.angle += angle this.x = Math.cos(this.angle) * this.length this.y = Math.sin(this.angle) * this.length }