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

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

      2. <tfoot id='bvlUy'></tfoot>
      3. 如何判断一个点是在一条线的右侧还是左侧

        时间:2023-07-25
          • <small id='iruUT'></small><noframes id='iruUT'>

                <tbody id='iruUT'></tbody>

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

                • <bdo id='iruUT'></bdo><ul id='iruUT'></ul>
                  <legend id='iruUT'><style id='iruUT'><dir id='iruUT'><q id='iruUT'></q></dir></style></legend>
                  本文介绍了如何判断一个点是在一条线的右侧还是左侧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一组点.我想将它们分成 2 个不同的集合.为此,我选择了两个点(ab)并在它们之间画一条假想线.现在我想把这条线左边的所有点放在一组中,把这条线右边的点放在另一组中.

                  I have a set of points. I want to separate them into 2 distinct sets. To do this, I choose two points (a and b) and draw an imaginary line between them. Now I want to have all points that are left from this line in one set and those that are right from this line in the other set.

                  我如何判断任何给定点 z 是在左边还是在右边?我试图计算 a-z-b – 之间的角度.小于 180 的角度在右侧,大于 180 的角度在左侧.但由于 ArcCos 的定义,计算出的角度总是小于 180°.是否有计算大于 180° 的角度的公式(或任何其他选择右侧或左侧的公式)?

                  How can I tell for any given point z whether it is in the left or in the right set? I tried to calculate the angle between a-z-b – angles smaller than 180 are on the right hand side, greater than 180 on the left hand side – but because of the definition of ArcCos, the calculated angles are always smaller than 180°. Is there a formula to calculate angles greater than 180° (or any other formula to chose right or left side)?

                  推荐答案

                  使用向量行列式的符号(AB,AM),其中M(X,Y)为查询点:

                  Use the sign of the determinant of vectors (AB,AM), where M(X,Y) is the query point:

                  position = sign((Bx - Ax) * (Y - Ay) - (By - Ay) * (X - Ax))
                  

                  一行是0,一侧是+1,另一侧是-1.

                  It is 0 on the line, and +1 on one side, -1 on the other side.

                  这篇关于如何判断一个点是在一条线的右侧还是左侧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:为什么 Decimal.Divide(int, int) 有效,但 (int/int) 无效? 下一篇:在二维点集中寻找孔?

                  相关文章

                  <tfoot id='wRglh'></tfoot>
                  1. <small id='wRglh'></small><noframes id='wRglh'>

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

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

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