难以计算Java的罪行定律

发布于 2025-02-06 21:42:49 字数 636 浏览 3 评论 0原文

在这方面,我正在尝试遵循罪恶法以找到角度A。正确的答案是39.41,但由于某种原因,我没有得到正确的逆正弦值。我该如何解决?

问题的可视化

import static java.lang.Math.*;
public class test
{
    public static void calculateAzimuth()
    {
        double a = 90;
        double A = 0;
        double c = 132.3459;
        double C = 111;
        
        //         a          C     c
        //sine^-1( 90* ( (sine111) /132.3459)) = A
        C = sin(toRadians(C));
        A = C/c; 
        A = (A*a);
        A = asin(A);
        System.out.println("Angle " + A);
    }
}

In this, I'm trying to follow law of sines in order to find angle A. The correct answer for this is 39.41 but for some reason, I'm not getting the correct inverse sine value. How can I fix this?

Visualization of the problem

import static java.lang.Math.*;
public class test
{
    public static void calculateAzimuth()
    {
        double a = 90;
        double A = 0;
        double c = 132.3459;
        double C = 111;
        
        //         a          C     c
        //sine^-1( 90* ( (sine111) /132.3459)) = A
        C = sin(toRadians(C));
        A = C/c; 
        A = (A*a);
        A = asin(A);
        System.out.println("Angle " + A);
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

行雁书 2025-02-13 21:42:49

您不会将A转换为一个程度的值。它仍然在弧度中。

You're not converting A to a value in degrees. It's still in radians.

铁轨上的流浪者 2025-02-13 21:42:49

调用todegrees您的结果

public static void main(String[] args) {
    double a = 90;
    double A = 0;
    double c = 132.3459;
    double C = 111;

    A = asin( sin(toRadians(C)) / c * a);
    System.out.println("Angle " + toDegrees(A));
}

call toDegrees on your result

public static void main(String[] args) {
    double a = 90;
    double A = 0;
    double c = 132.3459;
    double C = 111;

    A = asin( sin(toRadians(C)) / c * a);
    System.out.println("Angle " + toDegrees(A));
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文