LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with Tangent

Solved!
Go to solution

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

0 Kudos
Message 1 of 5
(3,383 Views)
You aren't calculating the tangent of 90 degrees, you are calculating the tangent of some number of radians. The tangent doesn't know about units, only values.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(3,373 Views)

@Boramina wrote:

[...] my program shows as result 1.63x10^16 [...]


Tan (90 degrees) = Opposite/Adjacent = 1/0

 

 https://www.google.com/search?q=Tan+(90+degrees)

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 3 of 5
(3,312 Views)
Solution
Accepted by Boramina

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

0 Kudos
Message 4 of 5
(3,252 Views)

@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.

0 Kudos
Message 5 of 5
(3,235 Views)