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
-
(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 theS_rectangle
be a rectangular square.
ThenT
is located within the rectangleS1 + S2 + S3 + S4 = S_rectangle
.
Reactangle one another, then follow these steps. -
Calculate the coordinates of all 8 digits of 2 rectangles.
-
Minimize all 4 * 4 = 16 pairs of digits (points from different rectangles). Let's denote this as
min_1
. -
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 itmin_2
. -
3
is shown as same, but taking the points from the second rectangle, lines from the first:
you getmin_3
. -
results = minute (min_1, min_2, min_3)