Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Calculate the Cosine and Sine of this angle using the Taylor Series given below: Sine(x) = x x3/3! + x5/5! x7/7! + x9/9! x11/11! +

Calculate the Cosine and Sine of this angle using the Taylor Series given below:

Sine(x) = x x3/3! + x5/5! x7/7! + x9/9! x11/11! +

Cosine(x) = 1 x2/2! + x4/4! x6/6! + x8/8! x10/10! +

The variable x is in radians and not degrees.

Note: See the PI calculator example in the examples directory on blackboard to get you started with series calculations.

Other trigonometric functions can be calculated using:

Tangent(x) = Sine(x)/Cosine(x)

CoSecant(x) = 1.0/Cosine(x)

You should use a while loop for this series. You will terminate the loop when the difference between previous and current calculated values is equal to or less than 0.0001.

You should test your functions using radians

To calculate the factorial of a number use a function called factorial(x). This function should take a double as a parameter and return a double as value. The factorial should be calculated using a for loop. Do not use one of the many recursive versions of this function available from the internet.

Note: All function variables and functions return types should be doubles.

Given Code for Sine

#include #include using namespace std;

const double PRECISION = 0.00001;

// Function prototype double mySine(double angie_in_radians);

// Create your function using the above prototype as a guide.

int main() {

/* Type your test code here. */

return 0; }

Given code for Cosine

#include #include using namespace std;

const double PRECISION = 0.00001;

// Function prototype double myCosine(double angie_in_radians);

// Create your function using the above prototype as a guide.

int main() {

/* Type your test code here. */

return 0; }

Given Code for Cotangent

#include #include using namespace std;

// copy functions from previous lab here

// Function prototype double myCotangent(double angie_in_radians);

// Create your function using the above prototype as a guide.

int main() {

/* Type your test code here. */

return 0; }

Given Code for Secant

#include #include using namespace std;

// copy functions from previous lab here

// Function prototype double myCotangent(double angie_in_radians);

// Create your function using the above prototype as a guide.

int main() {

/* Type your test code here. */

return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

5. Why is the job done?

Answered: 1 week ago