DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   C (http://www.daniweb.com/forums/forum118.html)
-   -   Generating sine wave (http://www.daniweb.com/forums/thread80015.html)

pretu Jun 4th, 2007 4:59 am
Generating sine wave
 
HI All
How can we generate a sine wave without using the sin() function.

Thanks
pretu

Jishnu Jun 4th, 2007 5:46 am
Re: Generating sine wave
 
you can use the sine series for calculation upto a certain accuracy and then plot the curve

Quote:

Originally Posted by pretu (Post 380468)
HI All
How can we generate a sine wave without using the sin() function.

Thanks
pretu


twomers Jun 4th, 2007 8:14 am
Re: Generating sine wave
 
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 ...

vegaseat Jun 4th, 2007 10:23 am
Re: Generating sine wave
 
Take a look at the code snippet at:
http://www.daniweb.com/code/snippet66.html

Salem Jun 4th, 2007 1:18 pm
Re: Generating sine wave
 
What's with all the "how to do x without using the obvious x" questions?
http://www.daniweb.com/techtalkforums/thread80025.html


All times are GMT -4. The time now is 11:44 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC