Skip to content

Commit

Permalink
fix: fixed polygon path generator
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobruni committed Feb 9, 2022
1 parent 29644fc commit 146afb6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions paths/polygon/src/PolygonPathGenerator.ts
Expand Up @@ -65,14 +65,10 @@ export class PolygonPathGenerator implements IMovePathGenerator {
}

private createDirs(): void {
this.dirsList = [];

for (let i = 0; i < 360; i += 360 / this.options.sides) {
const vec = Vector.origin;
vec.length = 1;
vec.angle = this.options.angle + i;
const angle = this.options.angle + i;

this.dirsList.push(vec);
this.dirsList.push(Vector.create(Math.cos((angle * Math.PI) / 180), Math.sin((angle * Math.PI) / 180)));
}
}
}

0 comments on commit 146afb6

Please sign in to comment.