필터 지우기
필터 지우기

How to connect two polygons with a perpendicular line? The line doesn't have to be at the actual points, just somewhere on the outer shape connected to the inner shape. I used roipoly to create the polygons.

조회 수: 2 (최근 30일)
Here is a picture of the two polygons. I am trying to create perpendicular lines connecting the blue shape to the red shape.

답변 (1개)

Bruno Luong
Bruno Luong 2018년 11월 9일
Apply this function with vertexes of one polygonal to the other, then the reverse.
  댓글 수: 2
Bruno Luong
Bruno Luong 2018년 11월 9일
편집: Bruno Luong 2018년 11월 9일
A projection is always "perpendicular". I put in the quote because:
  • if the closest point falls on a vertex, then you have two edges that are not in general parallel, so in the strict sense it doesn't mean anything meaningful, since the tangent is not defined at the vertexes. Since you works with a polygonal, therefore a piecewise linear shape.
  • If the closest point is in the middle of the edge, then yes.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by