help

hey guys can someone explain to me how can I solve this ,,,,,
Write two functions to compute the values of my_cos(x) and my_sin(x) respectively using the following Taylor series (x is any positive real number representing the angle in radians). Then, use these functions in main function to compute the following equation. Your program should ask user the following option:
Press t/T for tan(x)
Press s/S for Sin x
Press c/C for Cos x
Press * for exit the program.
Based on the input provided by the user, the program should ask user the value of x in radian and the value of term. Then, your program should print the result as shown in figure. Once, result is shown, the program will further show the menu as shown above until user chooses * as input to exit the program. For a wrong choice from the menu (other than t/T, s/S. c/C and *, your program should notify Wrong input and allow user to input his/her choice again).
Note:
Do not use the cos() and sin() functions that are available from the C standard library (math.h).
You will get ZERO if you used these two or any other function from the C standard library (math.h).
tan⁡(x)=sin⁡(x)/cos⁡(x)
sin⁡(x)=x-1/3! x^3+1/5! x^5-1/7! x^7+1/9! x^9-…
cos⁡(x)=1-1/2! x^2+1/4! x^4-1/6! x^6+1/8! x^8-…
Hint:
Write down a function named my_sin() with two input parameters: 1) the angle in radians (x) and 2) the number of terms in the Taylor series.
In the example below, the value of sin(x) is defined using 5 terms:
x,1/3! x^3,1/5! x^5,1/7! x^7 and 1/9! x^9.

Write another function named my_cos() with two input parameters: 1) the angle in radians (x) and 2) the number of terms in the Taylor series as you did with my_sin() function. In the main function, get the values of x and the number of terms and use the functions my_sin() and my_cos() to compute the value of tan(x).
Read through the assignment and start making notes of the functions that you'll need. Then re-read it, look at the functions you've designed and see if you've covered all the bases. For me, this means having the parameters and return values defined and some comments on what the functions should do. Then you just fill in the pieces.

In the case, you know that you need the my_sin() and my_cos() functions. Start by writing those. You might even create a short main() program that calls them with some test values to make sure you have them right.

Then you can concentrate of the menu parts.

When writing my_sin() and my_cos(), consider ways to optimize the calculations. You don't need to compute N! or X^N each time. For example, notice that for sin(), the Nth term TN is TN-1 *-1*x2/(2N-1)(2N-2)
thank you that was helpful really appreciate it ....
Topic archived. No new replies allowed.