I am trying to generate a set of points, which when plotted as a graph represent a sine wave of 1 cycle. The requirements are :
- a sine wave of 1 cycle
- lower limit = 29491
- upper limit = 36043
- no of points = 100
- Amplitude = 3276
- zero offset = 32767
Code :
int main()
{
ofstream outfile;
outfile.open("data.dat",ios::trunc | ios::out);
for(int i=0;i<100;i++)
{
outfile << int(3276*sin(i)+32767) << "\n";
}
outfile.close();
return 0;
}
I am generating and storing the points in a file. When these points are plotted I get the following graph.
But I only need one cycle. How can I do this?