开发者

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜