我必须绘制填充抛物线,现在我只是使用抛物线拉伸抛物线:
double dt = 0.0001;
for(double x = -50; x < 50; x+= dt){ // drawing parabola from -50 to 50
double y = x*x;
pic.drawPoint(x, y, cr, cg, cb); // x point, y point , R G B
}
为了让它填满抛物线的内部,我应该在这里改变什么?
答案 0 :(得分:0)
解决了我刚刚添加了另一个循环
double dt = 0.0001;
for(double x = -50; x < 50; x+= dt){ // drawing parabola from -50 to 50
double y = x*x;
for(double yy = y; yy < maxY; yy+=dt){
pic.drawPoint(x, yy, cr, cg, cb); // x point, y point , R G B
}
}