1) Write a program in C++ sin(x) can be approximately calculated using the following formula, where n!...

80.2K

Verified Solution

Question

Electrical Engineering

1) Write a program in C++

sin(x) can be approximately calculated usingthe following formula, where n! is factorial(n) – for example3!=3*2*1 = 6 (the function in previous problem).

The more terms we use in the series, the higher will be accuracyof the calculations. By using infinite terms in the series we willhave the exact value.

Hint 1: For n! simplyuse (copy and paste) the factorialFunc(n)from previous problem.

Hint 2: This problemsis similar to the “pi series” problem in the homework problems. Asimple for loop is needed. Much easier that it looks.

Write a program that gets x and calculatessin(x) using 10, 100, 1000 and 10,000 terms.

Then run the program and calculate and display the result forx=pi/6.

Answer & Explanation Solved by verified expert
3.5 Ratings (558 Votes)
From the given problem statement we can conclude that sinx isbeing computed using taylors seriesThe C code is given belowinclude using namespace    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students