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

    • <bdo id='wNXxO'></bdo><ul id='wNXxO'></ul>

        <small id='wNXxO'></small><noframes id='wNXxO'>

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

        时间:2023-05-28

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

            <tbody id='wHj24'></tbody>
          <legend id='wHj24'><style id='wHj24'><dir id='wHj24'><q id='wHj24'></q></dir></style></legend>

          <small id='wHj24'></small><noframes id='wHj24'>

            • <bdo id='wHj24'></bdo><ul id='wHj24'></ul>
              <tfoot id='wHj24'></tfoot>

                1. 本文介绍了如何计算两个角度测量值的差异?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何在 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;
                      }
                  

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

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

                  相关文章

                2. <legend id='kJg7I'><style id='kJg7I'><dir id='kJg7I'><q id='kJg7I'></q></dir></style></legend>

                3. <small id='kJg7I'></small><noframes id='kJg7I'>

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