#include <stdio.h>
#include "massa_molla.h"

void calc_integrale(float * in, int in_size,
                    float * out, float dt)
{
    int i;
      
    out[0] = ((in[0]+in[1])*dt)/2;
    for (i = 1; i < MAX_CAMPIONI-1;i++) {
        out[i] = out[i-1] +
             ((in[i]+in[i+1])*dt)/2;
    }
}

main()
{
      float integrale[MAX_CAMPIONI];
      int i;

      calc_integrale(traiettoria, MAX_CAMPIONI,
                     integrale, 0.01);
      
      for (i = 0;i < MAX_CAMPIONI-1;i++) {
          printf("%f --> %f\n", 
                 i*0.01, integrale[i]);
          if ((i % 20) == 19)
             system("pause");
      }
      system("pause");
}



