Anyone out there who can make the x[i] go forth and back ?
I want to create something like 0.0 , 0.1 , ... , 0.9 , 1.0 , 0.9 , ... , 0.1 , 0.0 , -0.1 , ... , -1.0 , -0.9 , -0.8 , ...Code:for(i=0;i<N-1;i++) { if(x[i]<1) x[i+1]=x[i]+Vx*dt; else x[i+1]=x[i]-Vx*dt; }
and so on as long as i<N, Vx means a velocity and dt means a time jump.
Thank you
joerg