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

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

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

        JavaScript中直线和圆之间的碰撞检测

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

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

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

                • 本文介绍了JavaScript中直线和圆之间的碰撞检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在寻找一个明确的答案,也许是一个函数,因为我很慢,它将确定线段和圆是否发生碰撞,在 javascript 中(使用画布)

                  I'm looking for a definitive answer, maybe a function cos I'm slow, that will determine if a line segment and circle have collided, in javascript (working with canvas)

                  像下面这样的函数,如果发生碰撞,则返回 true,否则返回 false.我什至可以给你捐一个婴儿.

                  A function like the one below that simply returns true if collided or false if not would be awesome. I might even donate a baby to you.

                  function isCollided(lineP1x, lineP1y, lineP2x, lineP2y, circlex, circley, radius) {
                  
                      ...
                  }
                  

                  我找到了很多公式,像这个,但它们超出了我的范围头.

                  I've found plenty of formulas, like this one, but they are over my head.

                  推荐答案

                  这里你需要一些数学:

                  如果您一般不知道如何求解方程,这是基本概念.我会把剩下的想法留给你.;) 弄清楚 CD 的长度并不难.

                  This is the basic concept if you don't know how to solve equations in general. I will leave the rest of the thinking to you. ;) Figuring out CD's length isn't that hard.

                  如果您要问如何,那就是如何:在 JavaScript 中查找冲突有点复杂.

                  If you are asking how, that's how: Finding collisions in JavaScript is kind of complicated.

                  这篇关于JavaScript中直线和圆之间的碰撞检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在谷歌地图上画圆弧 下一篇:盒子内 CSS 中的三角形

                  相关文章

                  最新文章

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

                  <tfoot id='sDlCA'></tfoot>

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

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