0 pretu 10 Years Ago HI All How can we generate a sine wave without using the sin() function. Thanks pretu c

0 Jishnu 160 10 Years Ago you can use the sine series for calculation upto a certain accuracy and then plot the curve HI All How can we generate a sine wave without using the sin() function. Thanks pretu

0 twomers 408 10 Years Ago I'm assuming you don't want to use the cosine function either :) You could create a table of results and read the values off that instead of using the sine function. Alternatively you could use exponentials and imaginary numbers ...

0 vegaseat 1,720 10 Years Ago Take a look at the code snippet at:http://www.daniweb.com/code/snippet66.html

0 Salem 5,138 10 Years Ago What's with all the "how to do x without using the obvious x" questions?http://www.daniweb.com/techtalkforums/thread80025.html

0 0x69 41 7 Years Ago HI All How can we generate a sine wave without using the sin() function. Thanks pretu You can try Taylor series also.

-1 jayeshkamble143 -4 6 Years Ago #include<iostream.h> #include<conio.h> #include<math.h> #include<graphics.h> int main(void) { int gdriver = DETECT, gmode; float x,w1,w,a,f,fs; cout<<"\n\tEnter amplitude:"; cin>>a; cout<<"\n\tEnter freq.:"; cin>>f; cout<<"\n\tEnter sampling points:"; cin>>fs; w=2*3.14*f; initgraph(&gdriver, &gmode, "c:\\tc\\bgi"); line(0, 0,0,500); line(0,200,800,200); // getch(); for(int n=0;n<640;n++) { w1=w*n; x=a*sin(w1/fs); x=x+200; putpixel(n,x,25); } getch(); closegraph(); return 0; } Edited 6 Years Ago by Nick Evan: Added CODE-tags.... Votes + Comments Salem: hijack + obsolete compiler + no code tags => EPIC FAIL