Is there a numerical method/built-in to calculate the boundary of a set of graphs?
Here is one way to do it, although it gives you a rasterised result.
graph = Table[
ParametricPlot[
RotationMatrix[m].{2 + 5 Cos[x], 3 + 6 Sin[x]}, {x, 0, 2 Pi},
PlotRange -> {{-10, 10}, {-10, 10}}, Axes -> None], {m, 0, Pi,
Pi/30}] // Flatten // Show
binary = graph // Binarize;
boundary = ImageAdd[
binary // ColorNegate // DeleteBorderComponents,
binary
] // EdgeDetect // ColorNegate
How it works
First, we render the graph
without the axes (like you already did):
Then we binarise it and store that in binary
:
We want to find the bounary of the outer black region. To do so, we first negate the binary image and remove the outer region with DeleteBorderComponents
(this is essentially a flood fill with black from the edges):
If we add these two images together, both the lines of the graph as well as all the regions it encloses will become white, because the lines are white in the original binary
image and the inner regions are white in the negated image. However, the outer region is black in both so it remains black:
Now it's trivial to detect the edge. Because EdgeDetect
shows edges in white on black, we're negating the image again to get black on white:
I'm looking forward to someone coming up with a solution that gives vectorised output!
Since you require the coordinates, a good starting point is to use my alphaShapes2D
code from here.
Now it's just a matter of the following one-liner:
breg = First @ ConnectedMeshComponents @ RegionBoundary @ alphaShapes2D[pts, 0.5]
Here pts
is as defined in the OP. Since you want the boundary coordinates. you can obtain it through Meshcoordinates
:
MeshCoordinates @ breg
Just take the union of the polygons defined by the curves. This uses only built-in functions and doesn't require parameter tuning. I've added RegionBoundary
to make it look like the other answers.
RegionBoundary@
BoundaryDiscretizeRegion@
RegionUnion[Polygon /@ ellipsePoints /@ coeff]
If I'm not mistaken, the $\alpha$-shape slightly smooths out the concave corner at the lower left of the figure, while the union doesn't.