VOOZH about

URL: https://www.geeksforgeeks.org/dsa/program-to-calculate-the-value-of-sinx-and-cosx-using-expansion/

⇱ Program to calculate the value of sin(x) and cos(x) using Expansion - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Program to calculate the value of sin(x) and cos(x) using Expansion

Last Updated : 23 Jul, 2025

Given a value of angle, you need to calculate Sin and Cos values corresponding to it.

For sin function

Examples:  

Input : 90
Output : 1


Output: 

1

Time Complexity: O(n)

Space Complexity: O(1)

For cos function

Examples:  

Input : 30
Output : 0.86602


Output: 

0.86602

Time Complexity: O(n)

Space Complexity: O(1)


If you like GeeksforGeeks(We know you do!) and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to review-team@geeksforgeeks.org.
 

Comment
Article Tags: