procedure b-spline: prepara i coefficienti b setbval prepara i coefficenti b per il calcolo di P(u): (cfr con B0=(1-u)^3, B1=3u(1-u)^2, B2=3u^2(1-u), B3=u^3 void setbval( ){/* prepare blend values for nn lines */ float u, u2, u3, u_1Alla3, b0,b1,b2,b3, Fact_b2; if(first_time) { for (int i=0; i<nb; i++) { /*nb=6=nr segm per sezione*/ u = i/fnb; u2 = u*u; u3 = u2*u; /* u da 0 a 1-1/6 */ u_1Alla3 = (1 - u) * (1 - u) * (1 - u); Fact_b2 = (((1 - u) * u +1) * u +1.0/3.0) / 2.0; b0= u_1Alla3/6.0; // b0= (1.0-u)*(1.0-u)*(1.0-u)/6.0; b2= Fact_b2; // b2= (-3*u3 + 3*u2 +3*u +1)/6.0; b3= u3 / 6.0; // b3= u^3/6.0; b1= 1-b0 -b2 -b3; // b1= (3*u3 - 6*u2 +4 )/6.0; b[0][i]= b0; b[3][i]= b3; b[2][i]= b2; b[1][i]= b1; } /* for i */ first_time=false; } /* if first_time */ } /* setbval */
{"Image DocumentName": "procedure b-spline: prepara i coefficienti b", "Image ImageDescription": "setbval prepara i coefficenti b per il calcolo di P(u): (cfr con B0=(1-u)^3, B1=3u(1-u)^2, B2=3u^2(1-u), B3=u^3. void setbval( ){/  prepare blend values for nn lines  / float u, u2, u3, u_1Alla3, b0,b1,b2,b3, Fact_b2; if(first_time) { for (int i=0; i<nb; i++) { / nb=6=nr segm per sezione / u = i/fnb; u2 = u u; u3 = u2 u; /  u da 0 a 1-1/6  / u_1Alla3 = (1 - u)   (1 - u)   (1 - u); Fact_b2 = (((1 - u)   u +1)   u +1.0/3.0) / 2.0; b0= u_1Alla3/6.0; // b0= (1.0-u) (1.0-u) (1.0-u)/6.0; b2= Fact_b2; // b2= (-3 u3 + 3 u2 +3 u +1)/6.0; b3= u3 / 6.0; // b3= u^3/6.0; b1= 1-b0 -b2 -b3; // b1= (3 u3 - 6 u2 +4 )/6.0; b[0][i]= b0; b[3][i]= b3; b[2][i]= b2; b[1][i]= b1; } /  for i  / first_time=false; } /  if first_time  / } /  setbval  / } /  setbval  /", "Image XResolution": "37", "Image YResolution": "37", "Image ResolutionUnit": "Pixels/Centimeter", "Image Software": "SlidePlayer", "Image YCbCrPositioning": "Centered"}