Find the nearest point of intersections of circles
2 次查看(过去 30 天)
显示 更早的评论
I need to find the nearest point of intersections of 4 circles. Centers of circles don't change, only the radius of circles changes. I know every intersection of each circle but I don't know how to find the average point of intersections 4 circles. Cannot find intersection of 4 circles, because the measurement error is too high, so I need to find some average point.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1046400/image.png)
2 个评论
Jan
2022-6-26
How is "average point of intersections 4 circles" mathematically defined? The 4 circles have 12 intersection points. If you have their positions, Matt J's auggestion sounds obvious.
采纳的回答
MJFcoNaN
2022-6-27
Hello,
You may need a different method than intersection. For example create a distance function under your own criterion. This is a simple one:
ori_x = [0 , 0 , -6.19, -6.1];
ori_y = [0 , 4.6 , 4.6 , 0 ];
r = [2.55, 4.05, 6.55, 3.65];
[xx, yy] = ndgrid(-20:1e-1:20,-20:1e-1:20);
vv = NaN([size(xx),4]);
for ii=1:4
vv(:,:,ii) = abs((xx-ori_x(ii)).^2+(yy-ori_y(ii)).^2-r(ii).^2);
end
vs = sum(vv,3);
vs(vs>100) = NaN;
contourf(xx,yy,vs)
[mm,I] = min(vs,[],"all","omitnan");
xx(I)
yy(I)
0 个评论
更多回答(1 个)
Sam Chak
2022-6-27
编辑:Sam Chak
2022-6-27
Some very simple calculations and math concepts (no looping) that you can definitely follow to find the intersections between the circles. Let's try an example with the red circle and the blue circle.
syms x y
% since red & blue circle aligned at the same y-axis, then pick x as variable
% intersections lie at the top of red circle (+) and bottom of blue circle (–)
redC = sqrt(2.55^2 - (x - 0)^2) + 0;
bluC = - sqrt(4.05^2 - (x - 0)^2) + 4.6;
eqn1 = redC == bluC;
solx = solve(eqn1);
solx = double(solx)
soly = subs(redC, x, solx);
soly = double(soly)
You should be able to find 6 intersections using this concept of coaxial centers.
For non-coaxial centers, let's try finding the intersections between the red circle and the green circle:
% One intersection lie at the top of red circle (+) and bottom of green circle (–)
redC = sqrt(2.55^2 - (x - 0)^2) + 0;
grnC = - sqrt(6.55^2 - (x + 6.19)^2) + 4.6;
eqn2 = redC == grnC;
solx = solve(eqn2);
solx = double(solx)
soly = subs(redC, x, solx);
soly = double(soly)
% One intersection lie at the bottom of red circle (–) and bottom of green circle (–)
redC = - sqrt(2.55^2 - (x - 0)^2) + 0;
grnC = - sqrt(6.55^2 - (x + 6.19)^2) + 4.6;
eqn3 = redC == grnC;
solx = solve(eqn3);
solx = double(solx)
soly = subs(redC, x, solx);
soly = double(soly)
You can find another 6 intersections using this concept of non-coaxial centers.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!