R
reagan
I am trying to get a program(in visual C++) to draw a sine curve (from
0 to 2pi). It takes 8 lines to draw the complete curve. However, the
user can choose to use up to 100 lines to make the curve smoother. How
do I get the program to calculate that? I thought of using a counter
to count through until it gets to the number of user chosen lines
(m_iSample), but then I don't know how to calculate it. I just
finished trig too, darn it.
for (count = 0; count<=m_iSample; ++count) {
double iSinValue=sin(count * PI);//do the sin calculation
int iFinalSinValue=iSinValue * 200;//convert result so that it will
display correctly
pDC->LineTo( ??? , iFinalSinValue);//draw the line
}
0 to 2pi). It takes 8 lines to draw the complete curve. However, the
user can choose to use up to 100 lines to make the curve smoother. How
do I get the program to calculate that? I thought of using a counter
to count through until it gets to the number of user chosen lines
(m_iSample), but then I don't know how to calculate it. I just
finished trig too, darn it.
for (count = 0; count<=m_iSample; ++count) {
double iSinValue=sin(count * PI);//do the sin calculation
int iFinalSinValue=iSinValue * 200;//convert result so that it will
display correctly
pDC->LineTo( ??? , iFinalSinValue);//draw the line
}