Given a value of cos(Θ) and a variable . The task is to find the value of cos(nΘ) using propety of trignomertric functions.
Note: n <= 15.
Input : cos(Θ) = 0.5, n = 10 Output : -0.5 Input :cos(Θ) = 0.5, n = 3 Output : -0.995523
Using De-Moivre’s theorem, we have:
Now, as the value of both sin(Θ) and cos(Θ) is known. Put the values in above equation to get the answer.
Below is the implementation of the above idea:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Find the maximum possible value of the minimum value of modified array
- Program to find greater value between a^n and b^n
- Program to find the value of tan(nΘ)
- Program to find the value of sin(nΘ)
- Program to find the Depreciation of Value
- Program to find value of 1^k + 2^k + 3^k + ... + n^k
- Program to find absolute value of a given number
- C program to calculate the value of nPr
- Program to calculate the value of sin(x) and cos(x) using Expansion
- Program to calculate value of nCr
- Program to calculate the value of nCr Efficiently
- Find length of period in decimal value of 1/n
- Find minimum number of coins that make a given value
- Find the minimum value of m that satisfies ax + by = m and all values after m also satisfy
- Find minimum value to assign all array elements so that array product becomes greater
- Find minimum value of y for the given x values in Q queries from all the given set of lines
- Find value of (1^n + 2^n + 3^n + 4^n ) mod 5
- Find value of y mod (2 raised to power x)
- Find value of (n^1 + n^2 + n^3 + n^4) mod 5 for given n
- Find the value of N XOR'ed to itself K times
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.