1. <small id='d0al2'></small><noframes id='d0al2'>

  2. <i id='d0al2'><tr id='d0al2'><dt id='d0al2'><q id='d0al2'><span id='d0al2'><b id='d0al2'><form id='d0al2'><ins id='d0al2'></ins><ul id='d0al2'></ul><sub id='d0al2'></sub></form><legend id='d0al2'></legend><bdo id='d0al2'><pre id='d0al2'><center id='d0al2'></center></pre></bdo></b><th id='d0al2'></th></span></q></dt></tr></i><div id='d0al2'><tfoot id='d0al2'></tfoot><dl id='d0al2'><fieldset id='d0al2'></fieldset></dl></div>

      <legend id='d0al2'><style id='d0al2'><dir id='d0al2'><q id='d0al2'></q></dir></style></legend>
      <tfoot id='d0al2'></tfoot>

        <bdo id='d0al2'></bdo><ul id='d0al2'></ul>

      如何计算两个角度测量值的差异?

      时间:2023-09-30

    1. <legend id='uXeEt'><style id='uXeEt'><dir id='uXeEt'><q id='uXeEt'></q></dir></style></legend>
        <i id='uXeEt'><tr id='uXeEt'><dt id='uXeEt'><q id='uXeEt'><span id='uXeEt'><b id='uXeEt'><form id='uXeEt'><ins id='uXeEt'></ins><ul id='uXeEt'></ul><sub id='uXeEt'></sub></form><legend id='uXeEt'></legend><bdo id='uXeEt'><pre id='uXeEt'><center id='uXeEt'></center></pre></bdo></b><th id='uXeEt'></th></span></q></dt></tr></i><div id='uXeEt'><tfoot id='uXeEt'></tfoot><dl id='uXeEt'><fieldset id='uXeEt'></fieldset></dl></div>
            <tbody id='uXeEt'></tbody>

          <tfoot id='uXeEt'></tfoot>

          1. <small id='uXeEt'></small><noframes id='uXeEt'>

            • <bdo id='uXeEt'></bdo><ul id='uXeEt'></ul>
              • 本文介绍了如何计算两个角度测量值的差异?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                如何在 Java 中计算两个角度测量值的差异(以度为单位),使结果在 [0°, 180°] 范围内?

                How can I calculate the difference of two angle measures (given in degrees) in Java so the result is in the range [0°, 180°]?

                例如:

                350° to 15° = 25°
                250° to 190° = 60°
                

                推荐答案

                    /**
                     * Shortest distance (angular) between two angles.
                     * It will be in range [0, 180].
                     */
                    public static int distance(int alpha, int beta) {
                        int phi = Math.abs(beta - alpha) % 360;       // This is either the distance or 360 - distance
                        int distance = phi > 180 ? 360 - phi : phi;
                        return distance;
                    }
                

                这篇关于如何计算两个角度测量值的差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:围绕点旋转三角形java 下一篇:如何在Java中绘制一个实心圆?

                相关文章

                最新文章

                1. <i id='3DKjL'><tr id='3DKjL'><dt id='3DKjL'><q id='3DKjL'><span id='3DKjL'><b id='3DKjL'><form id='3DKjL'><ins id='3DKjL'></ins><ul id='3DKjL'></ul><sub id='3DKjL'></sub></form><legend id='3DKjL'></legend><bdo id='3DKjL'><pre id='3DKjL'><center id='3DKjL'></center></pre></bdo></b><th id='3DKjL'></th></span></q></dt></tr></i><div id='3DKjL'><tfoot id='3DKjL'></tfoot><dl id='3DKjL'><fieldset id='3DKjL'></fieldset></dl></div>
                    <bdo id='3DKjL'></bdo><ul id='3DKjL'></ul>
                2. <small id='3DKjL'></small><noframes id='3DKjL'>

                  <legend id='3DKjL'><style id='3DKjL'><dir id='3DKjL'><q id='3DKjL'></q></dir></style></legend>
                3. <tfoot id='3DKjL'></tfoot>