• <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>

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

        Angle between two lines is wrong(两条线之间的角度是错误的)

      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.

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

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  How to convert 32 bit PNG to RGB565?(如何将 32 位 PNG 转换为 RGB565?)
                  Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)

                      <bdo id='vHQ8J'></bdo><ul id='vHQ8J'></ul>
                        <tbody id='vHQ8J'></tbody>

                    • <small id='vHQ8J'></small><noframes id='vHQ8J'>

                      • <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>