次のコードでは、
float i = Float.parseFloat(a);
float j = Float.parseFloat(b);
double div = (double)j/i;
float theta = (float) Math.atan(Math.toRadians(div));
theta
間違った値を取得します。私が見る限り、常に計算されますMath.tan
(これも試してみましたが、同じ結果が得られました)。Math.tan
なので、 orと書いてもMath.atan
同じ結果になります。
誰でも私を助けることができますか?
具体例:
i,j----> theta I get:
3,4-----> 0.023 while the correct one is arctan(4/3)=53.13 not tan(4/3)=0.023
3,6-----> 0.052 while the correct one is arctan(9/3)=71.56 not tan(9/3)=0.052