04-05-2015 10:17 PM
Hi! I have a problem, I want to calculate tan(90), but my program shows as result 1.63x10^16 and that's impossible, I don't know what's wrong, how can I fix it? Thank you in advance for the advice 🙂
P.S. I leave you a picture of my VI
Solved! Go to Solution.
04-05-2015 10:48 PM
04-06-2015 03:20 AM
@Boramina wrote:
[...] my program shows as result 1.63x10^16 [...]
Tan (90 degrees) = Opposite/Adjacent = 1/0
04-06-2015 02:30 PM
The tangent of 90° is infinite. When LabVIEW attempts to compute it (probably through a series approximation), rounding errors creep in and you get a Very Large Integer, instead. Look at the picture of the Tangent function -- see it approaching infinity at 90° (from the left) and rising from minus infinity as it crosses 90°?
Bob Schor
04-06-2015 04:46 PM
@Boramina wrote:
Hi! I have a problem, I want to calculate tan(90), but my program shows as result 1.63x10^16 and that's impossible,
Well, you get the tan of a number that is very, very close to 90 degrees. Ideally you should get +inf. floating point operations involving fractional values are almost never exact.
If you take the arctan of +Inf, you get Pi/2, though.
Please explain what you mean by "impossible". We are dealing with numerical methods, not with symbolic math here.