ทำตาราง ค่า Sine degree ครับ

Started by REDLINETECH, May 17, 2015, 10:49:47 PM

Previous topic - Next topic

REDLINETECH

ค่า sin() ใน C จะเป็น เรเดียล ครับจึงต้องแปลงองศาเป็นเรเดียลก่อนครับ

void Table_Sine_Wave(void)
{
   float  radians,pi=3.141,Sine_180[180];
   unsigned int degree;

    for(degree=0;degree<=180;degree++)
              { 
                        radians = degree*pi/180;

                   Sine_180[degree] =  sin(radians);
                     }
}