#include <stdio.h>
#include <string.h>

#define CFL 0.5

/*********************************************************************/
/* MacCormack                                                        */
/*********************************************************************/

double get_delta(double *current){
  double temp_forward, temp_backward;
  temp_forward = *current - (*(current+1) - *current) * CFL;
  temp_backward = *(current-1) - (*current - *(current-1)) * CFL;
  
  return (*current + temp_forward - (temp_forward - temp_backward) * CFL) / 2 - *current;
}


/*void apply_scheme(double *target, double *next, int divide){

  int i;
  double *_target, *_next;
  
  _target = target;
  _next = next;
  for(i = 1; i < divide - 1; i++) {
    target++;
    next++;
    
    *next = *target - (*(target+1) - *target) * CFL;
  }
  
  target = _target;
  next = _next;
  
  for(i = 1; i < divide - 1; i++) {
    target++;
    next++;
    
    *next = (*target + *next - (*next - *(next-1)) * CFL) / 2;
  }
}*/
