Why aren’t angles in js like the angles we’ve learnt about?
I’m trying to make spinner wheel in js, and noticed that using
for(i<sides)
const angle = (360 / sides) * i;
isn’t quite enough.
Why is that?
Later I found out that you have to do it like this
const sides = 3;
const angle = (i / sides) * (Math.PI * 2) - Math.PI / 2;
const x = Math.cos(angle) * radius + startingX;
New contributor
D K is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.