944,123 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 16977
  • C++ RSS
Sep 4th, 2007
0

how to Calculate Sin(x)

Expand Post »
I'm trying to calculate sin(x) without using
#include <math.h>

i need to use Maclaurin Series to calculate sin(x) with recursive process.

thanks
Similar Threads
Reputation Points: 10
Solved Threads: 1
Light Poster
fzafarani is offline Offline
33 posts
since Aug 2007
Sep 4th, 2007
0

Re: how to Calculate Sin(x)

http://mathworld.wolfram.com/MaclaurinSeries.html
Can you write either "raise to power" or "factorial" recursively?
Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005
Sep 4th, 2007
0

Re: how to Calculate Sin(x)

Yes, i can, either i know the formula of Maclaurin Series but i cant write the program!!!
Reputation Points: 10
Solved Threads: 1
Light Poster
fzafarani is offline Offline
33 posts
since Aug 2007
Sep 4th, 2007
1

Re: how to Calculate Sin(x)

It's hard to understand your problem then. If you know how to compute a Maclaurin series by hand, out to the point where the error is less than some tolerance level, why can't you write it in a program?

Of course, that's the whole point of this programming exercise, to convert the ability to do algorithms by hand to the ability to write computer programs that can perform the same algorithms.

You've got sin(x) = x - x^3/3! + x^5/5! - ... + (-1)^n*x^(2n+1)/(2n+1)! + ..., and there's some formula that tells you the error as well, when you've calculated to N terms.

Use a while loop, or a for loop, and calculate as many terms as you need.
Team Colleague
Reputation Points: 1135
Solved Threads: 173
Super Senior Demiposter
Rashakil Fol is offline Offline
2,479 posts
since Jun 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: SIP Gateway
Next Thread in C++ Forum Timeline: Integrating MSDN Library for VS 2005 into Visual C++ 2005 Express Edition





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC