I am trying to use sine and cosine in a Labview program. It seems to be working for the most part with one major execption which is when I give the Sine and Cosine VIs (the indivual ones the one with both) an angle of PI (PI/2, PI, 3PI/2, 2PI, 5PI/2, etc..) When I do this, the value that should go to 0 instead goes to some number either greater than 1 or less than -1. However, when I'm 1 degree off, the values are correct as they should be. My code is not complex at all.
Here is an example of an angle of 540 (3*PI) where Cosine should be -1 and Sine be 0. Notice that Cosine is correct but Sine is not 0:
Here is the same example but 1 degree less:
same example but with 1 degree more than 3*PI:
Here is the code I am using:
Is there a way to correct this or is there a better way I should be doing this?