void GambarKurvaBezier5(Graphics Img, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int x5, int y5)
{
int Px,Py,Qx,Qy;
Px=x1;
Py=y1;
for (float t=0;t<=1;t+=0.00001)
{
Qx = (int)((Math.pow((1-t),4)*x1) + (4*Math.pow((1-t),3)*t*x2) + (6*Math.pow((1-t),2)*Math.pow(t,2)*x3) + (4*(1-t)*Math.pow(t,3)*x4) + (Math.pow(t,4)*x5));
Qy = (int)((Math.pow((1-t),4)*y1) + (4*Math.pow((1-t),3)*t*y2) + (6*Math.pow((1-t),2)*Math.pow(t,2)*y3) + (4*(1-t)*Math.pow(t,3)*y4) + (Math.pow(t,4)*y5));
Garis(Img, Px,Py,Qx,Qy);
Px=Qx;
Py=Qy;
}
Garis(Img, Px,Py,x5,y5);
}
sumber : http://mohsodq1608.wordpress.com
1 comments:
kalo 6 titik kontrol bagaimana persamaannya ????
Post a Comment