1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nat2105 [25]
3 years ago
15

g Implement the Taylor Series for the Sine function using a loop. The mySine() function compares the previous calculated Sine to

the current calculated value of Sine. Once the difference between these two values is within the error (0.00001) indicated in the specification, the value should be returned to the calling function.
Mathematics
1 answer:
Luden [163]3 years ago
4 0

Answer:

#include <iostream>

#include <cmath>

double mySine(double x);

double factorial (int f);

double sine(double x);

double cosine(double x);

const double PI = atan(1.0)*4.0;

using namespace std;

int main(){

double x= 0.0;

double angle_in_radians;

double angle_in_degrees;

angle_in_radians = angle_in_degrees * PI/180.0;

while (x < 0.7853){

x = x + 0.261799;

angle_in_degrees = x * (180/PI);

}

cout << endl;

double factorial(int x);

double f = 1.0;

for (int i = 1; i <= x; i++){

f = f * i;

}

return f;

}

double sine (double x){

double sum_positive = 0.0;

double sum_negative = 0.0;

double output = 0.0;

double angle_in_degrees;

for (int i = 1; i <= 1000; i += 4){

sum_positive = sum_positive + factorial (i);

}

for (int i = 3; i <= 1000; i += 4){

sum_negative = sum_negative + factorial (i);

}

output = (sum_positive - sum_negative);

return output;

return angle_in_degrees = x * (180/PI);

}

Step-by-step explanation:

Implement the Taylor Series for the Sine function using a loop. The mySine() function compares the previous calculated Sine to the current calculated value of Sine. Once the difference between these two values is within the error (0.0001) indicated in the specification the value should be returned to the calling function.

Note: Make sure to create a function prototype for mySine() and place it above main()"

You might be interested in
Is y equals 2x + 4 linear or non-linear
Drupady [299]

Answer:

The equation listed is linear because 2x is a constant, meaning that it continuously moves in a straight line in one set direction.

Step-by-step explanation:

4 0
4 years ago
Read 2 more answers
HELP ASAP PLEASE!!!
PilotLPTM [1.2K]

Answer:

A

Step-by-step explanation:

The range is the y values of the function from the least to the greatest. To find it find the furthest point up and down. Draw a horizontal line from the point to the y-axis to identify the y value. Here the function extends from -3 to 6. So the range is -3\leq y\leq 6.

6 0
3 years ago
What is your opinion that we should raise the drinking/smoking ages to 21?
timofeeve [1]
In my opinion the ages for drinking/smoking should not be raised to 21. While I am not a fan of either and they almost never lead to good things, it just seems odd to me that a person can fight for his country at 18, but can't smoke or drink.
8 0
3 years ago
Read 2 more answers
PLZ I WILL MARK BRAINLEST I NEED HELP PLZZ​
vovangra [49]

Answer:

-8 i think

Step-by-step explanation:

5 0
3 years ago
640, 160, 40, 10,....
-Dominant- [34]
The pattern is dividing by 4 so it would be: 640 (divided by 4), 160 (divided by 4), 40 (divided by 4), 10 (divided by four), 5/2.
The next number would be 10/4 or 5/2 when simplified. (I’d go with 5/2 because teachers liked simplified numbers)
4 0
3 years ago
Other questions:
  • A traffic engineer is counting the number of vehicles by type that turn into a residential area. The table below shows the resul
    5·1 answer
  • How long will it take you to ski a distance of 36 miles at a speed of 3 miles per 30 minutes
    12·1 answer
  • Enjoy borrowed $1500 from her parents for car repairs. She plans to take 10% of her 450 weekly income to pay them back. At the i
    9·1 answer
  • Factor the expression. -x^2+3x+40
    7·1 answer
  • One hundred nautical miles equals about 185 kilometers. To the nearest kilometer, how far in kilometers is 290 nautical miles?
    11·2 answers
  • Choose what the expressions below best represent within the context of the word problem.
    15·1 answer
  • PLEASE HELP! Which number is a rational number?
    12·1 answer
  • Solving trig equations
    10·1 answer
  • Part B
    5·1 answer
  • erica would like to bake an 3-pound roast for a family gathering. the cookbook tells her to bake a 6-pound roast for 138 minutes
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!