<tfoot id='aqPS5'></tfoot>
  • <small id='aqPS5'></small><noframes id='aqPS5'>

      <bdo id='aqPS5'></bdo><ul id='aqPS5'></ul>
      <legend id='aqPS5'><style id='aqPS5'><dir id='aqPS5'><q id='aqPS5'></q></dir></style></legend>

        <i id='aqPS5'><tr id='aqPS5'><dt id='aqPS5'><q id='aqPS5'><span id='aqPS5'><b id='aqPS5'><form id='aqPS5'><ins id='aqPS5'></ins><ul id='aqPS5'></ul><sub id='aqPS5'></sub></form><legend id='aqPS5'></legend><bdo id='aqPS5'><pre id='aqPS5'><center id='aqPS5'></center></pre></bdo></b><th id='aqPS5'></th></span></q></dt></tr></i><div id='aqPS5'><tfoot id='aqPS5'></tfoot><dl id='aqPS5'><fieldset id='aqPS5'></fieldset></dl></div>
      1. 如何围绕另一个点旋转一个点

        时间:2023-09-25
          <tbody id='eBGAB'></tbody>
            <i id='eBGAB'><tr id='eBGAB'><dt id='eBGAB'><q id='eBGAB'><span id='eBGAB'><b id='eBGAB'><form id='eBGAB'><ins id='eBGAB'></ins><ul id='eBGAB'></ul><sub id='eBGAB'></sub></form><legend id='eBGAB'></legend><bdo id='eBGAB'><pre id='eBGAB'><center id='eBGAB'></center></pre></bdo></b><th id='eBGAB'></th></span></q></dt></tr></i><div id='eBGAB'><tfoot id='eBGAB'></tfoot><dl id='eBGAB'><fieldset id='eBGAB'></fieldset></dl></div>

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

            1. <legend id='eBGAB'><style id='eBGAB'><dir id='eBGAB'><q id='eBGAB'></q></dir></style></legend>
                <bdo id='eBGAB'></bdo><ul id='eBGAB'></ul>
                • <tfoot id='eBGAB'></tfoot>
                  本文介绍了如何围绕另一个点旋转一个点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在写一个游戏.我需要知道如何将点 a 围绕点 b 旋转给定的度数.我正在用 java 写这个,它将成为我的课程的一部分,Point.

                  I am writing a game. I need to know how to rotate point a around point b by a given number of degrees. I am writing this in java and it is going to be part of my class, Point.

                  推荐答案

                  double x1 = point.x - center.x;
                  double y1 = point.y - center.y;
                  
                  double x2 = x1 * Math.cos(angle) - y1 * Math.sin(angle));
                  double y2 = x1 * Math.sin(angle) + y1 * Math.cos(angle));
                  
                  point.x = x2 + center.x;
                  point.y = y2 + center.y;
                  

                  这种方法使用旋转矩阵.point"是你的a点,center"是你的b点.

                  This approach uses rotation matrices. "point" is your point a, "center" is your point b.

                  这篇关于如何围绕另一个点旋转一个点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Java中的旋转矩形 下一篇:Java2D - 如何旋转图像并保存结果

                  相关文章

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

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

                      <legend id='DzCBr'><style id='DzCBr'><dir id='DzCBr'><q id='DzCBr'></q></dir></style></legend>
                        <bdo id='DzCBr'></bdo><ul id='DzCBr'></ul>

                      <tfoot id='DzCBr'></tfoot>