1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| int main()
{
double u = 1;
double temp1,temp2,p;
int m,i,j,k =0;
int uuser = 10;
double ptfinal[2][uuser];
double points2[4][2]; //tableaux qui contiendra les nouvelles valeurs
double points[4][2]; // tableaux contenant des ordonnées et des abscisses
points[0][0] = 0;
points[0][1] = 1;
points[1][0] = 2;
points[1][1] = 2;
points[2][0] = 4;
points[2][1] = 0;
points[3][0] = 5;
points[3][1] = 3;
u = u/uuser;
m = 3;
while (k<=1)
{
for (i=0;i<4;i=i+1)// parcours des lignes de mon tableau "points"
{
for(j=0;j<2;j=j+1)// parcours des colonnes de mon tableau "points"
{
p = k;
temp1 = points[i][j];
temp2 = BezierGen(m,p,i);//fonction de calcul
points2[i][j] = temp1 * temp2 ;
}
}
k+=u;
}
for (k=0;k<=1;k = k + u)
{
for (i=0;i<2;i=i+1) // normalement je parcours les colonnes du tableaux points2
{
for(j=0;j<4;j=j+1)
{
ptfinal[i][k]+=points2[j][i];
}
}
printf("x=%lf|y=%lf",ptfinal[0][k],ptfinal[1][k]);
}
system("PAUSE");
return 0;
} |
Partager