In MathCAD, I used an expressions like:
if (cos(angle), expression 1, expression 2)
Meaning: if the cosine of the angle is not zero (TRUE), then evaluate expression 1, else expression 2.
or: if (1,2,3) yields 2
if (0,2,3) yields 3
I assumed that cos(PI/2) = 0.
BUT: it appears that 0 is not exactly 0. Even though I fill in n*(PI/2), and cos(angle) yields 0, the IF statement does not yield proper results.
Only if I round of cos(angle) at approx. 12-13 decimals, do I get proper results with the IF statement.
also, sign(cos(angle)) never yields 0, only 1 or -1. It should yield 0 at angle=PI/2.....
Did I miss something? Is there a better way then to "force" the results to 0 by rounding them off?
Any wizards here to help me out?
Thnks in advance,
tuduvu