User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 361,875 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,323 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser:
Views: 1887 | Replies: 4
Reply
Join Date: Jun 2007
Posts: 3
Reputation: pretu is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
pretu pretu is offline Offline
Newbie Poster

Generating sine wave

  #1  
Jun 4th, 2007
HI All
How can we generate a sine wave without using the sin() function.

Thanks
pretu
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 509
Reputation: Jishnu will become famous soon enough Jishnu will become famous soon enough 
Rep Power: 4
Solved Threads: 24
Jishnu's Avatar
Jishnu Jishnu is offline Offline
Posting Pro

Re: Generating sine wave

  #2  
Jun 4th, 2007
you can use the sine series for calculation upto a certain accuracy and then plot the curve

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

Thanks
pretu
Reply With Quote  
Join Date: May 2007
Location: Ireland
Posts: 1,697
Reputation: twomers will become famous soon enough twomers will become famous soon enough 
Rep Power: 6
Solved Threads: 24
twomers's Avatar
twomers twomers is offline Offline
Posting Virtuoso

Re: Generating sine wave

  #3  
Jun 4th, 2007
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 ...
"Mr Kitty, you have to live in the attic now. Here, write a diary."
I am the Walrus!
Reply With Quote  
Join Date: Oct 2004
Location: Mojave Desert
Posts: 2,275
Reputation: vegaseat is on a distinguished road 
Rep Power: 8
Solved Threads: 167
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
Kickbutt Moderator

Re: Generating sine wave

  #4  
Jun 4th, 2007
Take a look at the code snippet at:
http://www.daniweb.com/code/snippet66.html
May 'the Google' be with you!
Reply With Quote  
Join Date: Dec 2005
Posts: 2,909
Reputation: Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of 
Rep Power: 18
Solved Threads: 320
Colleague
Salem's Avatar
Salem Salem is offline Offline
void main'ers are DOOMed

Re: Generating sine wave

  #5  
Jun 4th, 2007
What's with all the "how to do x without using the obvious x" questions?
http://www.daniweb.com/techtalkforums/thread80025.html
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the C Forum

All times are GMT -4. The time now is 6:52 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC