Given a random set p of N points that in a known order form a non-intersecting polygon
In[]:=
pl=RandomPolygon[10];
In[]:=
p=PolygonCoordinates[pl]
Out[]=
{{0.179783,0.57135},{0.279118,0.609293},{0.354784,0.356823},{0.402835,0.0278031},{0.512392,0.235275},{0.551364,0.91872},{0.606836,0.924831},{0.660189,0.0157829},{0.786429,0.561368},{0.961246,0.585222}}
I now need to generate the line orthogonal to a segment, originating at the segment’s mid point {p[[α]], p[[α+1]] and terminating at the first point where it intersects another segment of the polygon, with the constraint that the orthogonal lines must be internal to the polygon and a requirement to then sample points along the orthogonal line at regular fractional intervals.
In[]:=
pv=PerpendicularBisector[p[[1;;2]]]
Out[]=
InfiniteLine[{0.22945,0.590321},{0.0379436,-0.0993347}]
In[]:=
Graphics[{pl,pv},Frame->True]
Out[]=
In[]:=
ℛ=RegionIntersection[pl,pv]
Out[]=
BooleanRegion#1&&#2&,Polygon
Number of points: 10
Embedding dimension: 2
,InfiniteLine[{0.22945,0.590321},{0.0379436,-0.0993347}]
In[]:=
Region[ℛ,FrameTrue]
Out[]=
Now how do I extract the line, as two terminating points, which includes the mid point of Line[p[[1;;2]]] from the set of lines forming the region ℛ?