geometry - Minimum distance between two rotated rectangles with different angles -


How can I calculate the minimum distance between the two rectangles?
It is not easy for rectangles, those who do not have an angle (i.e. 0 degrees one), but rotated rectangular with any different angle I do not know How to do it?
Can you recommend any kind?

Whitfloor

  1. (Try taking a point from a rectangle or else check it inside the other rectangle).
    There are several ways to do this: The following is a method ( not the best , but easy to explain).
    <1> A1 , A2 , A3 , A4 - rectangle number, T < / Code> - Some other point.
    Count the squares for the triangle:
    S1 = (A1, A2, T) , S2 = S (A2, A3, T) , < Code> S3 = S (A3, A4, T)
    , S4 = S (A4, A1, A2) .
    Let the S_rectangle be a rectangular square.
    Then T is located within the rectangle S1 + S2 + S3 + S4 = S_rectangle .
    Reactangle one another, then follow these steps.

  2. Calculate the coordinates of all 8 digits of 2 rectangles.

  3. Minimize all 4 * 4 = 16 pairs of digits (points from different rectangles). Let's denote this as min_1 .

  4. Then, take a few points from the rectangular (4 ways of doing it),
    take 4 sections (4 ways) of another rectangle,
    this Can be able to examine the segment within the block from the point or from that segment.
    Take the mineral content of this type of barbell. Let's call it min_2 .

  5. 3 is shown as same, but taking the points from the second rectangle, lines from the first:
    you get min_3 .

  6. results = minute (min_1, min_2, min_3)


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -