JavaScript - Drawing a Circle
I know there are already libraries for drawing a circle in JavaScript but I wanted to know how the actual maths of it works. Unfortunately there is no MathOverflow and I would of thought that with the number of programmers that are active here, someone will know what formula or concepts I 开发者_如何转开发need to use.
Actually, there is a 'math overflow': https://math.stackexchange.com/
However, the formula you need to use is along these lines.
x = radius*Math.cos(angle) + centerX;
y = radius*Math.sin(angle) + centerY;
精彩评论