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

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

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

      1. <tfoot id='B6Ns7'></tfoot>
        • <bdo id='B6Ns7'></bdo><ul id='B6Ns7'></ul>

        在给定中心点、半径和度数的圆上找到点

        Find the point on a circle with given center point, radius, and degree(在给定中心点、半径和度数的圆上找到点)

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

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

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

                  本文介绍了在给定中心点、半径和度数的圆上找到点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我已经有 10 年没有做过这样的数学运算了……我正在编写一个 2D 游戏并让玩家四处移动.当我移动玩家时,我试图计算距离玩家位置 200 像素的圆上的点,给定 -360 到 360 之间的正或负角度(度).屏幕为 1280x720,0,0 为中心点的屏幕.玩家在整个笛卡尔坐标系中移动.我试图找到的点可能不在屏幕上.

                  It's been 10 years since I did any math like this... I am programming a game in 2D and moving a player around. As I move the player around I am trying to calculate the point on a circle 200 pixels away from the player position given a positive OR negative angle(degree) between -360 to 360. The screen is 1280x720 with 0,0 being the center point of the screen. The player moves around this entire Cartesian coordinate system. The point I am trying trying to find can be off screen.

                  我尝试了文章 找到具有半径的点上的公式和角度,但我不相信我理解角度"是什么,因为当我将角度作为 -360 到 360 传递给 Cos(angle) 或 Sin(angle) 时,我会得到奇怪的结果.

                  I tried the formulas on article Find the point with radius and angle but I don't believe I am understanding what "Angle" is because I am getting weird results when I pass Angle as -360 to 360 into a Cos(angle) or Sin(angle).

                  例如我有...

                  • 1280x720 在笛卡尔平面上
                  • 中心点(玩家的位置):
                    • 让 x = 一个介于最小值 -640 到最大值 640 之间的数字
                    • 让 y = 最小 -360 到最大 360 之间的数字

                    在圆上返回 X 的公式是什么?

                    在圆上返回 Y 的公式是什么?

                    推荐答案

                    链接中的简单方程给出了圆上点的 X 和 Y 坐标相对于圆心.

                    The simple equations from your link give the X and Y coordinates of the point on the circle relative to the center of the circle.

                    X = r * cosine(angle)  
                    Y = r * sine(angle)
                    

                    这告诉您该点偏离圆心的距离.由于您有中心的坐标(Cx,Cy),只需添加计算出的偏移量.

                    This tells you how far the point is offset from the center of the circle. Since you have the coordinates of the center (Cx, Cy), simply add the calculated offset.

                    圆上点的坐标为:

                    X = Cx + (r * cosine(angle))  
                    Y = Cy + (r * sine(angle))
                    

                    这篇关于在给定中心点、半径和度数的圆上找到点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Performance overhead of using attributes in .NET(在 .NET 中使用属性的性能开销)
                  Accessing attribute info from DTE(从 DTE 访问属性信息)
                  c# Hide a property in datagridview with datasource(c#使用数据源隐藏datagridview中的属性)
                  Extract Display name and description Attribute from within a HTML helper(从 HTML 帮助器中提取显示名称和描述属性)
                  C# Attributes and their uses(C# 属性及其用途)
                  C# - Getting all enums value by attribute(C# - 按属性获取所有枚举值)

                  1. <tfoot id='d4rb0'></tfoot>

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

                    1. <legend id='d4rb0'><style id='d4rb0'><dir id='d4rb0'><q id='d4rb0'></q></dir></style></legend>
                        <tbody id='d4rb0'></tbody>

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

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