
#include "AnT.hpp"

#define a parameters[0]
#define b parameters[1]
#define X currentState[0]

// return value x mod y is between 0 and y
real_t mod (real_t x, real_t y)
{
    if (x > 0)
	while (x > y) 
	    x -= y;
    else
	while (x < 0) 
	    x += y;

    return x;
}

bool circle_1d (const Array<real_t>& currentState,
	       const Array<real_t>& parameters,
	       Array<real_t>& RHS)
{
    RHS[0] = mod (X + b - a / Two_Pi * sin (Two_Pi * X), 1.0);
    return true;
}


#undef a
#undef b
#undef X    

extern "C" 
{

void connectSystem ()
{
  MapProxy::systemFunction = circle_1d;
}

}




