Why the trigonometry results are different
古いコメントを表示
Why there is a difference in the results. in degrees it is showing inf and in radians a different result?
>> a=tan(90)
a =
-1.9952
>> b=tand(90)
b =
Inf
>> c=tan(pi/2)
c =
1.6331e+16
採用された回答
その他の回答 (3 件)
David Sanchez
2014 年 8 月 21 日
1 投票
The different result between tan(90) and tan(pi/2) is obvious.
1.6331e+16 might be considered equal to inf
Iain
2014 年 8 月 21 日
That's likely just the effect of small numerical errors.
After all, according to matlab,
1E300 + 1 - 1E300 = 0, and
1E300 - 1E300 + 1 = 1
Adam
2014 年 8 月 21 日
0 投票
tan is asymptotic at 90 degrees, but pi/2 will not evaluate to the precise equivalent with a numerical estimate of pi so its result will not be precisely on the asymptote
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!