如何绘制Android的钟形曲线? [英] How to draw a bell curve in android?
问题描述
我想绘制android.Is有没有免费的图书馆钟形曲线(正态分布),这从中我能得到一些帮助,或任何其他方式。我试过的方式,但我认为这是不恰当的。我用这个方程,通过自己增加x轴和相对于X轴获得y轴坐标。
I am trying to draw a bell curve(Normal distribution) in android.Is there any free library for this from which i can get some help or any other way. I tried a way but i think this is not appropriate. I used this equation, increasing the x-axis by myself and getting the y-axis co-ordinates with respect to x-axis.
for (int i = 0; i < 1000; i++) {
x = (float) ( i * 0.5);
yy=(float) (1/Math.sqrt(0.5)*Math.sqrt(2*Math.PI));
y=(float) (yy*Math.exp(-Math.pow(x, 2)/2*.5));
xcord.add(x);
ycord.add(y);
}
和然后通过使用该图线
for(i=0;i<arraysize;i++)
canvas.drawLine(xcord.get(i),ycord.get(i),xcord.get(i+1),ycord.get(i+1), paint);
我没有,虽然成功了,不知道怎么弄,这将形成一个钟形曲线的坐标。
I have not succeeded though, don't know how to get coordinates which will form a bell curve.
推荐答案
这是由开发者所做的一个项目....
This is a project made by developers....
的http://$c$c.google.com/p/chartdroid/
HTTP://$c$c.google.com/p/ chartdroid /维基/截图
这篇关于如何绘制Android的钟形曲线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!