久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

      2. <small id='jKqkq'></small><noframes id='jKqkq'>

          <bdo id='jKqkq'></bdo><ul id='jKqkq'></ul>
      3. 矩形與矩形相交的面積

        Area of rectangle-rectangle intersection(矩形與矩形相交的面積)
          <bdo id='1yPgJ'></bdo><ul id='1yPgJ'></ul>
        • <legend id='1yPgJ'><style id='1yPgJ'><dir id='1yPgJ'><q id='1yPgJ'></q></dir></style></legend>
              <tbody id='1yPgJ'></tbody>

                • <tfoot id='1yPgJ'></tfoot>

                  <small id='1yPgJ'></small><noframes id='1yPgJ'>

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

                  本文介紹了矩形與矩形相交的面積的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  下面是 2 個矩形.給定矩形頂點的坐標-(x1, y1)...(x8, y8),如何計算重疊區域(下圖中的白色)的面積?

                  注意:

                  Below are 2 rectangles. Given the coordinates of the rectangle vertices - (x1, y1)...(x8, y8), how can the area of the overlapping region (white in the figure below) be caclulated?

                  Note that:

                  1. 點的坐標可以是任意的
                  2. 矩形可以重疊也可以不重疊
                  3. 當矩形不重疊,或者它們在點或線處重疊時,假設面積為 0.
                  4. 如果一個矩形在另一個矩形內,則計算較小矩形的面積.

                  推薦答案

                  既然你說矩形可能沒有對齊,那么可能的答案可能是空無、一個點、一條線段或一個有 3-8 條邊的多邊形.

                  Since you stated that the rectangles may not be aligned, possible answers may be nothing, a point, a line segment, or a polygon with 3-8 sides.

                  執行此2d boolean 操作的通常方法是選擇邊緣的逆時針順序,然后評估臨界點(交點或角)之間的邊緣段.在每個交點處,您可以在第一個矩形的邊緣段和第二個矩形的邊緣之間切換,反之亦然.您總是選擇上一個片段左側的片段.

                  The usual way to do this 2d boolean operation is to choose a counterclockwise ordering of the edges, and then evaluate edge segments between critical points (intersections or corners). At each intersection you switch between an edge segment of the first rectangle to an edge of the second, or visa-versa. You always pick the segment to the left of the previous segment.

                  有很多細節,但基本算法是找到所有交叉點并使用適當的數據結構在它們的邊緣上對它們進行排序.選擇一個交點(如果有)并選擇一條遠離該交點的線段.找到所選起始線段左側的另一個矩形的線段.在圖中,我們選擇交叉點a(箭頭所示方向)上的綠色線段作為參考線段.另一個矩形右側的線段是從ab 的線段.將其用作下一個參考線段,并在其左側選擇一個綠色線段.這是從 bc 的片段.以相同的方式查找段 cd.下一段是從 d 到角點,所以角點也在交點的頂點列表中.從玉米我們回到a.

                  There are LOTS of details, but the basic algorithm is to find all intersections and order them on their edges with an appropriate data structure. Choose an intersection (if there is one) and choose a line segment leading away from that intersection. Find the segment of the other rectangle to the left of the chosen starting segment. In the picture, we choose the green segment on intersection a (in the direction indicated by the arrow) as the reference segment. The segment of the other rectangle that is to the right, is the segment from a to b. Use that as the next reference segment, and choose a green segment to the left of it. That's the segment from b to c. Find segment cd the same way. The next segment is from d to the corner, so the corner is in the vertex list for the intersection as well. From the corn we get back to a.

                  要每次選擇左側,請使用相交邊的方向向量坐標的確定.如果有序的有向邊對的行列式是正的,那么你就走對了.

                  To choose the left side each time, you use the determinate of the coordinates of the direction vectors for the edges that meet. If the determinant for the ordered pair of directed edges is positive, you're going the right way.

                  既然您有了相交多邊形的頂點,您就可以使用調查者的公式得到面積.

                  Now that you have the vertices of the intersection polygon, you can use the surveyor's formula to get the area.

                  我要留給你的一些細節是:

                  Some of the details that I'm leaving to you are:

                  • 如果一個角與另一個三角形的邊或頂點重合怎么辦?

                  • What if a corner is coincident to to an edge or vertex of the other triangle?

                  如果沒有交叉點怎么辦?(一個矩形在另一個里面,或者它們是不相交的——你可以使用多邊形點檢查來解決這個問題.參見 關于多邊形的維基百科文章.

                  What if there are no intersections? (one rectangle is inside the other, or they are disjoint--you can use point-in-polygon checks to figure this out. See the Wikipedia article on polygons.

                  如果交點是單點或線段怎么辦?

                  What if the intersection is a single point or a segment?

                  這篇關于矩形與矩形相交的面積的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                  When and how should I use exception handling?(我應該何時以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構造函數的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區別)

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

                        <tbody id='OIXc6'></tbody>

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

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

                          1. <i id='OIXc6'><tr id='OIXc6'><dt id='OIXc6'><q id='OIXc6'><span id='OIXc6'><b id='OIXc6'><form id='OIXc6'><ins id='OIXc6'></ins><ul id='OIXc6'></ul><sub id='OIXc6'></sub></form><legend id='OIXc6'></legend><bdo id='OIXc6'><pre id='OIXc6'><center id='OIXc6'></center></pre></bdo></b><th id='OIXc6'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='OIXc6'><tfoot id='OIXc6'></tfoot><dl id='OIXc6'><fieldset id='OIXc6'></fieldset></dl></div>
                            主站蜘蛛池模板: 色婷婷国产精品综合在线观看 | 狼色网 | 理论片87福利理论电影 | 成人免费一级 | 国产视频在线观看一区二区三区 | 日韩看片| 国产精品a久久久久 | 中文av字幕 | 亚洲国产高清高潮精品美女 | 在线观看深夜视频 | 精品久久影院 | 国产精品成人av | 国产精品中文字幕在线播放 | 成人高清在线 | 免费日本视频 | 亚洲va欧美va天堂v国产综合 | 国产视频一区在线观看 | 欧美日韩精品影院 | 青春草国产 | 免费一区二区三区在线视频 | 亚洲视频中文字幕 | 国产欧美一区二区精品忘忧草 | 久久婷婷色 | 精品国产伦一区二区三区观看方式 | 久久出精品 | 欧美日韩在线成人 | 久久91精品国产一区二区三区 | 国产精彩视频在线观看 | 日韩国产黄色片 | 最新国产精品 | 色婷婷综合网 | jlzzjlzz国产精品久久 | 久久香蕉精品视频 | av中文字幕在线播放 | 久久久性色精品国产免费观看 | 欧美 日韩 国产 在线 | 伊人国产精品 | 在线三级电影 | 日韩久久精品电影 | 日韩a在线 | 国产激情在线看 |