• <tfoot id='Mk59d'></tfoot><legend id='Mk59d'><style id='Mk59d'><dir id='Mk59d'><q id='Mk59d'></q></dir></style></legend>

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

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

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

        两条线之间的角度是错误的

        时间:2024-08-12

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

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

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

            • <tfoot id='FKTQQ'></tfoot>
                <tbody id='FKTQQ'></tbody>

                  本文介绍了两条线之间的角度是错误的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I want to get angles between two line. So I used this code.


                  int posX = (ScreenWidth) >> 1;
                  
                  int posY = (ScreenHeight) >> 1;
                  
                  double radians, degrees;
                  
                  radians = atan2f( y - posY , x - posX);
                  
                  degrees = -CC_RADIANS_TO_DEGREES(radians);
                  
                  NSLog(@"%f %f",degrees,radians);
                  


                  But it doesn't work . The Log is that: 146.309935 -2.553590

                  What's the matter? I can't know the reason. Please help me.

                  解决方案

                  If you simply use

                  radians = atan2f( y - posY , x - posX);
                  

                  you'll get the angle with the horizontal line y=posY (blue angle).

                  You'll need to add M_PI_2 to your radians value to get the correct result.

                  这篇关于两条线之间的角度是错误的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何检查设备是否有网络连接:cocos-2d 下一篇:如何实现高清“Retina Display"Cocos2D 中的图形

                  相关文章

                      <bdo id='vHQ8J'></bdo><ul id='vHQ8J'></ul>
                  1. <small id='vHQ8J'></small><noframes id='vHQ8J'>

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

                      <legend id='vHQ8J'><style id='vHQ8J'><dir id='vHQ8J'><q id='vHQ8J'></q></dir></style></legend>

                      <tfoot id='vHQ8J'></tfoot>