1 #include "../include/Matematica.h" 12 Resp = QUAD((1-x))*P1[y]+2*(1-x)*x*P2[y]+QUAD(x)*P3[y];
17 if(x < 0 || x>3 || y < 0 || y>3){
18 printf(
"x,y must be 0 <= %d , %d < 3\n",x,y);
21 double Deltax = P2[x] - P1[x];
26 Sp.
a3 = (Par.
a2 - Sp.
a2)/(3.*Deltax);
27 Sp.
a1 = (P2[y] - P1[y])/Deltax - Sp.
a2*Deltax - Sp.
a3*Deltax*Deltax;
29 SpMem.
a1 = Sp.
a1+2*Sp.
a2*Deltax+3*Sp.
a3*Deltax*Deltax;
36 if(x < 0 || x>3 || y < 0 || y>3){
37 printf(
"x,y must be 0 <= %d , %d < 3\n",x,y);
40 double Deltax = P2[x] - P1[x];
44 Sp.
a3 = (Par.
a2 - Sp.
a2)/(3.*Deltax);
45 Sp.
a1 = (P2[y] - P1[y])/Deltax - Sp.
a2*Deltax - Sp.
a3*Deltax*Deltax;
54 if(x < 0 || x>3 || y < 0 || y>3){
55 printf(
"x,y must be 0 <= %d , %d < 3\n",x,y);
58 double Deltax = P2[x] - P1[x];
61 Sp.
a3 = (0. - SpMem.
a2)/(3.*Deltax);
62 Sp.
a1 = (P2[y] - P1[y])/Deltax - Sp.
a2*Deltax - Sp.
a3*Deltax*Deltax;
70 if(x < 0 || x>3 || y < 0 || y>3){
71 printf(
"x,y must be 0 <= %d , %d < 3\n",x,y);
74 double Deltax = P2[x] - P1[x];
79 Sp.
a4 = 3.*Cub.
a3/Deltax + (Sp.
a2 - Cub.
a2)/QUAD(Deltax);
81 Sp.
a3 = Cub.
a3 - 6.*Sp.
a4*Deltax;
82 Sp.
a1 = (P2[y] - P1[y])/Deltax - Sp.
a2*Deltax - Sp.
a3*Deltax*Deltax - Sp.
a4*Deltax*Deltax*Deltax;
89 if(x < 0 || x>3 || y < 0 || y>3){
90 printf(
"x,y must be 0 <= %d , %d < 3\n",x,y);
93 double Deltax = P2[x] - P1[x];
98 Sp.
a4 = 3.*Cub.
a3/Deltax + (Sp.
a2 - Cub.
a2)/QUAD(Deltax);
100 Sp.
a3 = Cub.
a3 - 6.*Sp.
a4*Deltax;
101 Sp.
a1 = (P2[y] - P1[y])/Deltax - Sp.
a2*Deltax - Sp.
a3*Deltax*Deltax - Sp.
a4*Deltax*Deltax*Deltax;
110 if(x < 0 || x>3 || y < 0 || y>3){
111 printf(
"x,y must be 0 <= %d , %d < 3\n",x,y);
114 double Deltax = P2[x] - P1[x];
121 Sp.
a4 = Par.
a2 + 2.*Sp.
a2 - 3.*(P2[y] - P1[y])/(Deltax*Deltax) + 3.*Sp.
a1/Deltax;
123 Sp.
a3 = (P2[y] - P1[y])/(Deltax*Deltax*Deltax) - Sp.
a1/(Deltax*Deltax) - Sp.
a2/Deltax - Sp.
a4*Deltax;
131 if(x < 0 || x>3 || y < 0 || y>3){
132 printf(
"x,y must be 0 <= %d , %d < 3\n",x,y);
135 double Deltax = P2[x] - P1[x];
139 Sp.
a3 = (Sp.
a2 - Par.
a2)/Deltax + 4.*SpMem.
a3;
140 Sp.
a4 = (SpMem.
a3 - Sp.
a3)/(6.*Deltax);
141 Sp.
a1 = (P2[y] - P1[y])/Deltax - Sp.
a2*Deltax - Sp.
a3*Deltax*Deltax - Sp.
a4*Deltax*Deltax*Deltax;
149 if(x < 0 || x>3 || y < 0 || y>3){
150 printf(
"x,y must be 0 <= %d , %d < 3\n",x,y);
153 double Deltax = P2[x] - P1[x];
158 Sp.
a4 = (SpMem.
a3 - Sp.
a3)/(6.*Deltax);
159 Sp.
a1 = (P2[y] - P1[y])/Deltax - Sp.
a2*Deltax - Sp.
a3*Deltax*Deltax - Sp.
a4*Deltax*Deltax*Deltax;
180 if(x < 0 || x>3 || y < 0 || y>3){
181 printf(
"x,y must be 0 <= %d , %d < 3\n",x,y);
184 double Deltax = P2[x] - P1[x];
185 double Deltax2 = QUAD(P2[x]) - QUAD(P1[x]);
186 double Dx = P3[x] - P1[x];
187 double Dx2 = QUAD(P3[x]) - QUAD(P1[x]);
188 double Deltay = P2[y] - P1[y];
189 double Dy = P3[y] - P1[y];
190 double b1= Dy - Deltay/Deltax2*Dx2;
191 double b2= Dx - Deltax/Deltax2*Dx2;
193 Par.
a2 = Deltay/Deltax2 - Par.
a1*Deltax/Deltax2;
194 Par.
a0 = P1[y] - Par.
a1*P1[x] - Par.
a2*QUAD(P1[x]);
201 if(x < 0 || x>3 || y < 0 || y>3){
202 printf(
"x,y must be 0 <= %d , %d < 3\n",x,y);
205 double DxAB = PA[x] - PB[x];
206 double DxCB = PC[x] - PB[x];
207 double DyCB = PC[y] - PB[y];
208 double DyAB = PA[y] - PB[y];
209 double a1 = DyCB * DxAB - DyAB * DxCB;
210 double a2 = DxCB*DxCB*DxAB - DxCB*DxAB*DxAB;
212 Par.
a1 = DyAB/DxAB - Par.
a2*DxAB;
220 if(x < 0 || x>3 || y < 0 || y>3){
221 printf(
"x,y must be 0 <= %d , %d < 3\n",x,y);
224 double DxCA = PC[x] - PA[x];
225 double DxBA = PB[x] - PA[x];
226 double DyAC = PA[y] - PC[y];
227 double DyAB = PA[y] - PB[y];
228 double DxAB2 = QUAD(PA[x]) - QUAD(PB[x]);
229 double DxAC2 = QUAD(PA[x]) - QUAD(PC[x]);
230 double DyBA2 = QUAD(PB[y]) - QUAD(PA[y]);
231 double DyCA2 = QUAD(PC[y]) - QUAD(PA[y]);
232 double a1 = DxCA*(DyBA2 - DxAB2) - DxBA*(DyCA2 - DxAB2);
233 double a2 = 2.*(DyAC*DxBA - DyAB*DxCA);
235 Cir.
xC = (DyBA2 - DxAB2 + 2.*Cir.
yC*DyAB)/DxBA;
236 Cir.
Rad = sqrt( QUAD((PA[x] - Cir.
xC)) + QUAD((PA[y] - Cir.
yC)) );
241 if(x < 0 || x>3 || y < 0 || y>3){
242 printf(
"x,y must be 0 <= %d , %d < 3\n",x,y);
245 double DyDB = PD[y] - PB[y];
246 double DyCB = PC[y] - PB[y];
247 double DyAB = PA[y] - PB[y];
248 double DxDB = PD[x] - PB[x];
249 double DxCB = PC[x] - PB[x];
250 double DxAB = PA[x] - PB[x];
251 double DxCA = PC[x] - PA[x];
252 double Num3 = DyDB/DxDB - DyAB/DxAB - (DyCB/DxCB - DyAB/DxAB)*(DxDB - DxAB)/DxCA;
253 double Den3 = DxDB*DxDB - DxAB*DxAB - (DxCB*DxCB - DxAB*DxAB)*(DxDB - DxAB)/DxCA;
255 Cub.
a2 = DyCB/DxCB - DyAB/DxAB - Cub.
a3*(DxCB*DxCB - DxAB*DxAB);
257 Cub.
a1 = DyAB/DxAB - Cub.
a2*DxAB - Cub.
a3*DxAB*DxAB;
264 if(x < 0 || x>3 || y < 0 || y>3){
265 printf(
"x,y must be 0 <= %d , %d < 3\n",x,y);
268 double Dx = ASS((PC[x] - PB[x]));
269 Forth.
a3 = PA[y]/12. - PB[y]/6. + PD[y]/6. - PE[y]/12.;
270 Forth.
a3 /= -Dx*Dx*Dx;
271 Forth.
a1 = - PA[y]/12. + 4.*PB[y]/6. - 4.*PD[y]/6. + PE[y]/12.;
273 Forth.
a4 = PA[y]/24. - PB[y]/6. + 1./4.*PC[y] - PD[y]/6. + PE[y]/24.;
274 Forth.
a4 /= Dx*Dx*Dx*Dx;
275 Forth.
a2 = -PA[y]/24. + 2./3.*PB[y] - 5./4.*PC[y] + 2./3.*PD[y] - PE[y]/24.;
281 double DxCA = PC[x] - PA[x];
282 double DxCB = PC[x] - PB[x];
283 double DxCD = PC[x] - PD[x];
284 double DxCE = PC[x] - PE[x];
285 double DxAB = PA[x] - PB[x];
286 double DxAD = PA[x] - PD[x];
287 double DyAC = (PA[y] - PC[y])/DxCA;
288 double DyBC = (PB[y] - PC[y])/DxCB;
289 double DyDC = (PD[y] - PC[y])/DxCD;
290 double DyEC = (PE[y] - PC[y])/DxCE;
294 double DxDB = PD[x] - PB[x];
295 double DxEA = PE[x] - PA[x];
296 double DyBD = (PB[y] - PD[y])/DxDB;
297 double DyAE = (PA[y] - PE[y])/DxEA;
299 Forth.
a4 = DyBC - DyDC - DyEC + DyAC;
300 Forth.
a4 /= (DxCE*DxCE*DxCE - DxCA*DxCA*DxCA) - (DxCB*DxCB*DxCB - DxCD*DxCD*DxCD);
301 Forth.
a2 = DyBC - DyDC - Forth.
a4*(DxCB*DxCB*DxCB - DxCD*DxCD*DxCD);
302 Forth.
a3 = DyBD - DyAE;
303 Forth.
a3 /= (DxCB*DxCB*DxCB - DxCD*DxCD*DxCD)/DxDB -
304 (DxCA*DxCA*DxCA - DxCE*DxCE*DxCE)/DxEA;
305 Forth.
a1 = DyAE - Forth.
a3*(DxCA*DxCA*DxCA - DxCE*DxCE*DxCE)/DxEA;
309 double DxAE = PA[x] - PE[x];
310 double Den34 = DxAB*(DxCB*DxCB - DxCA*DxCA) - DxAB*(DxCD*DxCD - DxCA*DxCA);
311 double Num34 = DxAB*(DxCD*DxCD*DxCD - DxCA*DxCA*DxCA) - DxAD*(DxCB*DxCB*DxCB - DxCA*DxCA*DxCA);
312 double Noto34 = DyBC*DxAD - DyAC*DxAD - DyDC*DxAB + DyAC*DxAB;
313 double Num4 = -DxAB*(Noto34*(DxCE*DxCE - DxCA*DxCA) - DyEC + DyAC) +
314 DxAE*(Noto34*(DxCB*DxCB - DxCA*DxCA) - DyBC + DyAC);
315 double Den4 = DxAB*(Num34/Den34*(DxCE*DxCE - DxCA*DxCA) + (DxCE*DxCE*DxCE - DxCA*DxCA*DxCA) ) -
316 DxAE*(Num34/Den34*(DxCB*DxCB - DxCA*DxCA) + (DxCB*DxCB*DxCB - DxCA*DxCA*DxCA));
318 Forth.
a4 = Num4/Den4;
319 Forth.
a3 = Num34/Den34*Forth.
a4 + Noto34;
320 Forth.
a2 = DyBC - DyAC - Forth.
a3*(DxCB*DxCB - DxCA*DxCA) - Forth.
a4* (DxCB*DxCB*DxCB - DxCA*DxCA*DxCA);
322 Forth.
a1 = DyAC - Forth.
a2*DxCA - Forth.
a3*DxCA*DxCA - Forth.
a4*DxCA*DxCA*DxCA;
330 for(
int r=0;r<NMass;r++){
332 for(
int c=0;c<NMass;c++){
337 for(
int c=0;c<NMass;c++){
338 for(
int r=0;r<NMass;r++){
347 double MenoDue = - .75*Wg.
a3 + 1.5*Wg.
a4;
349 double MenoUno = -.5*Wg.
a1 + Wg.
a2 + 1.5*Wg.
a3 - 6.*Wg.
a4;
351 double Zero = Wg.
a0 - 2.*Wg.
a2 + 9.*Wg.
a4;
353 double PiuUno = .5*Wg.
a1 + Wg.
a2 - 1.5*Wg.
a3 - 6.*Wg.
a4;
355 double PiuDue = .75*Wg.
a3 + 1.5*Wg.
a4;
357 for(
int r=0;r<NMass;r++){
358 if(r> 1) Coeff->
Set(r,r-2,MenoDue*Px[r-2]);
359 if(r> 0) Coeff->
Set(r,r-1,MenoUno*Px[r-1]);
360 if(r< NMass-1) Coeff->
Set(r,r+1,PiuUno*Px[r+1]);
361 if(r< NMass-2) Coeff->
Set(r,r+2,PiuDue*Px[r+2]);
362 Coeff->
Set(r,r,Zero*Px[r]);
366 for(
int r=0;r<NMass;r++){
367 for(
int c=0;c<NMass;c++){
375 double m = (Py2-Py1)/(Px2-Px1);
376 double q = Py1 - m*Px1;
381 double Uno=0.;
double Due=0.;
double Tre=0.;
double Quattro=0.;
382 double UnoUno=0.;
double DueUno=0.;
double ZeroUno=0.;
double ZeroDue=0.;
383 for(
int i=0;i<NMass;i++){
388 UnoUno += Px[i]*Py[i];
389 ZeroDue += QUAD(Py[i]);
391 double Mediax = Uno / (double) NMass;
392 double Mediay = ZeroUno / (double) NMass;
393 double Scartox = (Due - NMass*Uno*Uno)/(
double)(NMass-0);
394 double Scartoy = (ZeroDue - NMass*ZeroUno*ZeroUno)/(
double)(NMass-0);
395 r1.
m = (NMass*UnoUno - Uno*ZeroUno) / (NMass*Due - Uno*Uno);
396 r1.
q = (ZeroUno - r1.
m*Uno)/NMass;
397 double Posteriori = 0.;
398 r1.
Cov = UnoUno/(double)NMass - Mediax*Mediay;
399 for(
int i=0;i<NMass;i++){
400 Posteriori += QUAD(( Px[i]*r1.
m + r1.
q - Py[i] ));
402 r1.
Corr = r1.
Cov / ( sqrt(Scartox*Scartoy) );
403 r1.
ErrY = sqrt(Posteriori/(
double)(NMass-2));
404 r1.
ErrM = r1.
ErrY * sqrt( NMass / (NMass * Due - Uno*Uno));
405 r1.
ErrQ = r1.
ErrY * sqrt( Due / (NMass*Due - Uno*Uno) );
421 double Uno=0.;
double Due=0.;
double Tre=0.;
double Quattro=0.;
422 double UnoUno=0.;
double DueUno=0.;
double ZeroUno=0.;
double ZeroDue=0.;
423 for(
int i=0;i<NMass;i++){
425 Uno += Px[i]*Peso[i];
426 Due += QUAD(Px[i]*Peso[i]);
428 UnoUno += Px[i]*Py[i]*Peso[i];
429 ZeroDue += QUAD(Py[i]);
431 Mediax = Uno / (double) NMass/Pesox;
432 Mediay = ZeroUno / (double) NMass;
433 Scartox = (Due - Uno*Uno/QUAD(Pesox))/(
double)NMass;
434 Scartoy = (ZeroDue - ZeroUno*ZeroUno)/(
double)NMass;
435 r1.
Corr = (UnoUno - Uno*ZeroUno) / (
double) NMass/Pesox ;
436 r1.
r = r1.
Corr / ( sqrt(Scartox*Scartoy) );
437 r1.
m = (NMass*UnoUno - Uno*ZeroUno) / (NMass*Due - Uno*Uno)/Pesox;
438 r1.
ErrM = Scartoy * sqrt( Due / (NMass * Due - Uno*Uno)/QUAD(Pesox));
439 r1.
q = (ZeroUno - r1.
m*Uno)/NMass;
440 r1.
ErrQ = Scartoy * sqrt( NMass / (NMass * Due - Uno*Uno)/QUAD(Pesox) );
445 double Uno=0.;
double Due=0.;
double Tre=0.;
double Quattro=0.;
446 double UnoUno=0.;
double DueUno=0.;
double ZeroUno=0.;
double ZeroDue=0.;
447 for(
int i=0;i<NMass;i++){
454 ZeroUno += log10(Py[i]);
455 UnoUno += Px[i]*log10(Py[i]);
456 ZeroDue += QUAD(log10(Py[i]));
458 double Mediax = Uno / (double) NMass;
459 double Mediay = ZeroUno / (double) NMass;
460 double Scartox = (Due - NMass*Uno*Uno)/(
double)(NMass-1);
461 double Scartoy = (ZeroDue - NMass*ZeroUno*ZeroUno)/(
double)(NMass-1);
462 r1.
m = (NMass*UnoUno - Uno*ZeroUno) / (NMass*Due - Uno*Uno);
463 r1.
q = (ZeroUno - r1.
m*Uno)/NMass;
464 double Posteriori = 0.;
465 r1.
Cov = UnoUno/(double)NMass - Mediax*Mediay;
466 for(
int i=0;i<NMass;i++){
467 Posteriori += QUAD(( Px[i]*r1.
m + r1.
q - log10(Py[i]) ));
469 r1.
Corr = r1.
Cov / ( sqrt(Scartox*Scartoy) );
470 r1.
ErrY = sqrt(Posteriori/(
double)(NMass-2));
471 r1.
ErrM = r1.
ErrY * sqrt( NMass / (NMass * Due - Uno*Uno));
472 r1.
ErrQ = r1.
ErrY * sqrt( Due / (NMass*Due - Uno*Uno) );
482 for(
int i=0;i<NMax;i++){
484 if(Py[i] < 0.){printf(
"Invalid weight %lf < 0\n",Py[i]);}
486 if(Px[i]<m1.
Min) m1.
Min = Px[i];
487 if(Px[i]>m1.
Max) m1.
Max = Px[i];
488 m1.
Uno += Px[i]*Py[i];
489 Sum2 += SQR(Px[i])*Py[i];
493 m1.
Due = sqrt(Sum2 - m1.
Uno*NMax)/(double)(NMax-1);
498 double Uno=0.;
double Due=0.;
double Tre=0.;
double Quattro=0.;
499 double UnoUno=0.;
double DueUno=0.;
double ZeroUno=0.;
double ZeroDue=0.;
500 for(
int i=0;*(Px+i)<b || i<NMass;i++){
504 Due += QUAD(*(Px+i));
505 Tre += *(Px+i)*QUAD(*(Px+i));
506 Quattro += QUAD(QUAD(*Px+i));
507 UnoUno += *(Px+i) * *(Py+i);
508 DueUno += QUAD(*(Px+i)) * *(Py+i);
510 ZeroDue += QUAD(*(Py+i));
514 double X2 = NMass*Due - Uno*Uno;
515 double X3 = NMass*Tre - Due*Uno;
516 double X4 = NMass*Quattro - Due*Due;
517 double XY = NMass *UnoUno - Uno*ZeroUno;
518 double X2Y = NMass*DueUno - Due*ZeroUno;
519 Par.
a2 = (X4*X2 - X3*X3)/(X2Y*X2 - X3*XY);
520 Par.
a1 = (Par.
a2*XY - X3)/X2;
521 Par.
a0 = (ZeroUno - Par.
a1*Uno - Par.
a2*Due)/(
double)NMass;
529 double Uno=0.;
double Due=0.;
double Tre=0.;
double Quattro=0.;
530 double UnoUno=0.;
double DueUno=0.;
double ZeroUno=0.;
double ZeroDue=0.;
531 for(
int i=0;i<NMass;i++){
534 Tre += Px[i]*Px[i]*Px[i];
535 Quattro += Px[i]*Px[i]*Px[i]*Px[i];
536 UnoUno += Px[i]*Py[i];
537 DueUno += Px[i]*Px[i]*Py[i];
539 ZeroDue += Py[i]*Py[i];
541 double X2 = NMass*Due - Uno*Uno;
542 double X3 = NMass*Tre - Due*Uno;
543 double X4 = NMass*Quattro - Due*Due;
544 double XY = NMass *UnoUno - Uno*ZeroUno;
545 double X2Y = NMass*DueUno - Due*ZeroUno;
546 Par.
a2 = (X2Y*X2 - X3*XY)/(X4*X2 - X3*X3);
547 Par.
a1 = (XY - Par.
a2*X3)/X2;
548 Par.
a0 = (ZeroUno - Par.
a1*Uno - Par.
a2*Due)/(
double)NMass;
558 if( ( x >= dPoint[nPoint])&&( x < dPoint[nPoint+1]))
564 double Primo = (x - dPoint[nPoint])/(dPoint[nPoint+nOrder] - dPoint[nPoint])*
Blend(dPoint,x,nPoint,nOrder-1);
565 double Secondo = (dPoint[nPoint+nOrder+1]-x)/(dPoint[nPoint+nOrder+1] - dPoint[nPoint+1])*
Blend(dPoint,x,nPoint+1,nOrder-1);
566 if( (dPoint[nPoint+nOrder-1] == dPoint[nPoint]) && (dPoint[nPoint+nOrder] == dPoint[nPoint+1]) )
568 else if(dPoint[nPoint+nOrder] == dPoint[nPoint])
570 else if(dPoint[nPoint+nOrder] == dPoint[nPoint+1])
573 Resp = Primo + Secondo;
589 if( (dPoint[nP*Incr] <= x)&&(x<dPoint[(nP+1)*Incr]))
595 if( (dPoint[(nP+nO-1)*Incr] == dPoint[nP*Incr]) && (dPoint[(nP+nO)*Incr] == dPoint[(nP+1)*Incr]) )
597 else if(dPoint[(nP+nO)*Incr] = dPoint[(nP)*Incr])
598 Resp = (dPoint[(nP+nO)*Incr] - x)/(dPoint[(nP+nO)*Incr] - dPoint[(nP+1)*Incr])*
Blend(dPoint,Incr,x,nP,nO-1);
599 else if(dPoint[(nP+nO)*Incr] == dPoint[(nP+1)*Incr])
600 Resp = (x - dPoint[(nP)*Incr])/(dPoint[(nP+nO-1)*Incr] - dPoint[(nP)*Incr])*
Blend(dPoint,Incr,x,nP+1,nO-1);
602 Resp = (dPoint[(nP+nO)*Incr] - x)/(dPoint[(nP+nO)*Incr] - dPoint[(nP+1)*Incr])*
Blend(dPoint,Incr,x,nP,nO-1) + (x - dPoint[nP*Incr])/(dPoint[(nP+nO-1)*Incr] - dPoint[nP*Incr])*
Blend(dPoint,Incr,x,nP+1,nO-1);
SPLINE Spline4Beg(double *P1, double *P2, double *P3, double *P4, int x, int y)
Four order spline first boundary.
double a4
a0 + a1*x + a2*x^2 + a3*x^3 + a4^4
double a1
a0 + a1 x + a2 x^2
coeficients of a N order spline
int DerMatrix(double *Px, double *Py, int NMass, SPLINE Wg, Spline *Sp)
Boh.
SPLINE Spline3Beg(double *P1, double *P2, double *P3, int x, int y)
Three order spline first boundary.
SPLINE Spline4End(double *P1, double *P2, int x, int y)
Four order spline last boundary.
void AddCoe(double Val, int n)
Add to the n coefficient.
double xC
x position of the center
PARABOLA MinimoParabola(double a, double b, double *Px, double *Py, int NMass)
Minimum of the Parabola between.
double a2
a0 + a1 x + a2 x^2
double LinInterp(double Px1, double Px2, double Py1, double Py2, double x)
Linear interpolation between two points.
SPLINE Spline4PreEnd(double *P1, double *P2, double *P3, int x, int y)
Four order spline just before the end.
double MinimoY
Minimum of the parabola.
double ErrQ
Error on the intercept.
SPLINE Parab2(double *PA, double *PB, double *PC, int x, int y)
Three points parabolic interpolation.
double a3
a0 + a1*x + a2*x^2 + a3*x^3 + a4^4
Moments of a distribution.
SPLINE Spline4(double *P1, double *P2, double *P3, double *P4, int x, int y)
Four order spline.
RETTA InterExp(double *Px, double *Py, int NMass)
Exponential interpolation.
double Rad
Radius of the circle.
double Val(int row)
Returns a value in 1d.
double ErrM
Error on the slope.
double a2
a0 + a1*x + a2*x^2 + a3*x^3 + a4^4
double a0
a0 + a1 x + a2 x^2
double a1
a0 + a1*x + a2*x^2 + a3*x^3 + a4^4
double ErrY
Error a posteriori.
int Polinomio(double *P1, double *P2, int NMass, Spline *Sp)
Polinimial interpolation of NMass order.
SPLINE Spline3End(double *P1, double *P2, int x, int y)
Three order spline last boundary.
Matrice computes the algebric operations on matrices.
double Elevato(double x, int Volte)
Integer power.
bool Set(int row, int column, double Val)
Set a coefficient.
CIRCLE Osculante(double *PA, double *PB, double *PC, int x, int y)
Osculant circle.
double Minimo
Minimum of the parabola.
MOMENTI InterGauss(double *Px, double *Py, int NMass)
Gaussian interpolation.
SPLINE Parab(double *P1, double *P2, double *P3, int x, int y)
Three points parabolic interpolation.
int Num
Number of points considered.
SPLINE Spline3(double *P1, double *P2, double *P3, int x, int y)
Three order spline.
double a0
a0 + a1*x + a2*x^2 + a3*x^3 + a4^4
Radius and center of a circle.
SPLINE Forth(double *PA, double *PB, double *PC, double *PD, double *PE, int x, int y)
Five points four order interpolation.
SPLINE Cubica(double *PA, double *PB, double *PC, double *PD, int x, int y)
Four point cubic interpolation.
double Blend(const double *dPoint, double x, int nPoint, int nOrder)
For the BSpline.
double QBezier(double *P1, double *P2, double *P3, double x, int y)
QBezier curve of three points.
double yC
y position of the center
double Delta
Step interval.
void SetCoe(double Val, int n)
Set the n coefficient.
RETTA InterRett(double *Px, double *Py, int NMass)
Linear interpolation.