Can someone propose some code that will "connect the dots" using circular arcs?
Show older comments
Hi,
Can someone propose some alternate or additional code (to the code proposed in my last posting here) that will automatically connect the dots (dots = center points of each triplet), as shown below, to generate the correct polygons from the given points in the attached file (fpep.mat)?
Note 1: The edges of each polygon must be circular arcs (we cannot use splines for this one) that connect all the center points.
Note 2: Each "triplet" will produce precesely 3 circular arcs (except for those along the outer borders).
Note 3: Each arc's initial and final slopes are given by the angle between the centerpoint and the corresponding endpoint for that arc (remember that the inital and final slopes of each arc must be equal-and-opposite; so, the "starting" and "landing" angles must be averaged).
The coords of each endpoint are contained in the first 6 columns of the attached file (fpep.mat) and the coords of the center points are contained in the last two columns.
Once again, I'm excited to see what you can come up with. Thanks in advance for your help!

5 Comments
Steve
on 14 Nov 2019
Image Analyst
on 17 Nov 2019
But the whole assumption that there will be one single arc is questionable. Getting an arc for a particular cell wall will have one arc if you fit points on one side of the cell wall, but an arc in the opposite direction if you consider using points on the OTHER side of the cell wall. Any way to resolve that? If they are like cell walls of air bubbles in suds/lather/foam, then is the "pressure" inside each cell the same, or does it vary with cell size, such that the cell on one side may influence the arc direction more than the cell on the other side?
Steve
on 17 Nov 2019
Image Analyst
on 17 Nov 2019
You did not answer the question. Let me try again.
- If one arcs up, however shallowly, and one arcs down, which equation/arc do you pick?
- And, why would you even pick either of them? Why not just say the connecting edge is a straight line?
- Why do you think you NEED an arc rather than a straight line?
Accepted Answer
More Answers (2)
Steven Lord
on 14 Nov 2019
0 votes
Are you trying to do something like path planning for an autonomous vehicle, passing through waypoints along the way? If so consider the functions for that purpose in Automated Driving Toolbox.
I have attached a version of TripletGraph.m which implements methods of joining the points with ideal circular arcs, as well as with the spline and quadratic approximations discussed previously. The code below plots your data with circular and quadratic arcs super-imposed. To my eye, there is no visible difference, so it seems like it should be sufficient to use the quadratic approximation, which as I have said is numerically a lot safer.
load fpep
obj=TripletGraph(fpep);
figure(1);
obj.plotcirc; %join with ideal circular arc formula
hold on;
obj.plotquad; %join with quadratic approximation
hold off

14 Comments
Steve
on 18 Nov 2019
I must have failed again however, to make known what is really needed here though. What we really need is a single, continuous, circular arc that starts at one center point and ends on the next (for all center points).
I am confused. The plotcirc() command does exactly that. What are you saying is 'discontinuous' about the circular arcs that it is drawing?
Steve
on 18 Nov 2019
Well, yes, any plot on a digital computer is a joining of discrete points, just like any digital image is composed of discrete pixels. But the difference here, as compared to the spline approximation from before, is that here the discrete points are derived from the exact equation of, and lie on, an actual circle, as opposed to some cubic polynomial curve. Are you saying that when you zoom the plot, you want Matlab to resample the ideal circle more finely?
Steve
on 18 Nov 2019
It's possible to write a function to return any continuous query point on a specified arc, but you need to decide on some way of parametrizing the arcs, so you can tell the function where along the arc you want to evaluate the point. In the code as it is now, these lines
s=sqrt(Dcot.^2-(t.^2-D.^2))-Dcot;
XY=(C1+C2)/2+U*t+W*s;
compute the XY coordinate located at a (signed) distance t from the center of the chord. If you like that parameterization, you can easily reuse those calculations in a separate query function.

Steve
on 19 Nov 2019
Matt J
on 19 Nov 2019
The radius is
norm(C1-C2)/(2*sind(theta));
Steve
on 19 Nov 2019
Matt J
on 19 Nov 2019
You already have it. I’ve made no real changes.
Steve
on 19 Nov 2019
Steve
on 19 Nov 2019
Steve
on 20 Nov 2019
Steve
on 21 Nov 2019
Categories
Find more on Spline Postprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






