I wrote this code for smoothing of a curve . It takes 5 points next to a point and adds them and averages it .
/* Smoothing */ void smoothing(vector
You make addition with point itself when you need to take neighbor points - just offset index by 1:
for(int j=0;j