1 2 3 4 5 6 7 8 9 10 11 12 13 14
| Vector points = new Vector ();
points.addElement (new Point (100,0,0));
points.addElement(new Point (300,0,0));
points.addElement(new Point (500,0,0));
points.addElement(new Point (100,350,0));
points.addElement(new Point (100,200,0));
float xt=0, yt=0;
for (int i=0; i<5; i++)
for(int t=0; t<=1; t+=0.1){
Point M = (Point)bbb.elementAt(i);
xt+= combinaison(i,4) * (float)Math.pow(t,i)*(float)Math.pow(1-t, 4-i)* M.x;
yt+= combinaison(i,4) * (float)Math.pow(t,i)*(float)Math.pow(1-t, 4-i)* M.y;
dessinerPoint(new Point (xt, yt, 0));
} |
Partager