Click here to Skip to main content
15,914,419 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
what is time complexity of using trigonometric function like sin,cos. is they affect compiling time?
Posted
Updated 1-Oct-15 1:47am
v2

And, that does not affect the compiling time, at all. Instead, complex trigonometric functions can affect execution time.
 
Share this answer
 
The execution time of such functions is implementation dependent, some insight here: "How does C compute sin() and other math functions?"[^].
See also "Computational complexity of mathematical operations"[^].
 
Share this answer
 
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!

But here is a hint: Look at the Math class[^]
 
Share this answer
 
Comments
Patrice T 1-Oct-15 6:05am    
+5
Quote:
what is time complexity of using trigonometric function like sin,cos. is they affect compiling time?

Your question is not complete or you misunderstood what is time complexity, because it make no sense.

There is no time complexity per se for trigonometric functions, or it is equal to 1.
SIN(1), SIN(2), SIN(100), SIN(2100) all take the same time ?
and the answer is the same for COS.

This does not mean that SIN or COS are simple by themselves.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900