I'm researching some computational geometry and am trying to find a method of determining the {x,y} intersection of a circle and BSplineCurve for further processing.
basisPoints = {{0, 0}, {3000, 7000}, {4000, -7000}, {5000,
7000}, {8000, 0}};
f = BSplineFunction[basisPoints];
p = ParametricPlot[f[t], {t, 0, 1}, MeshFunctions -> {"ArcLength"},
Mesh -> {10}, MeshStyle -> {PointSize[0.01], Red}];
points = Cases[Normal[p], _Point, Infinity];
ptsPlus = Point /@ {f[0], f[1]};
points = SortBy[points~Join~ptsPlus, First];
Show[
ParametricPlot[f[t], {t, 0, 1}],
Graphics[Circle[#, 1400]] & /@ points[[All, 1]],
Graphics[{AbsolutePointSize[9], Red, points}],
PlotRange -> All
]
Most potential solutions I've come across online so far have the curve in a different form. However, for the project we really want to try to use BSplineCurves
because of their ease of input by other users, making the final curve somewhat arbitrary. Mathematica is great for offering BSplineFunction
in this regard. Before I go through of all the trouble of translating this curve into a more conventional form, is there a straightforward way to find where this Circle
and BSplineFunction
intersect?
cir = Circle[#, 1400] & /@ (Cases[points, Point[x_] :> x, Infinity]);
RegionPlot[{
cir[[1]] // DiscretizeGraphics ,
spline // DiscretizeGraphics},
Frame -> False
]
p
andcoords
are not defined. Looks likep = ParametricPlot[f[t], {t, 0, 1}, MeshFunctions -> {"ArcLength"}, Mesh -> 10]
andcoords = points[[All, 1]];
? $\endgroup$