Find the nearest point of intersections of circles

조회 수: 3 (최근 30일)
Marek Konopka
Marek Konopka 2022년 6월 26일
편집: Sam Chak 2022년 6월 27일
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.
  댓글 수: 2
Matt J
Matt J 2022년 6월 26일
Why not use mean?
Jan
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
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)
ans = -1.1000
yy(I)
ans = 0.6000

추가 답변 (1개)

Sam Chak
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)
solx = 2×1
-2.2371 2.2371
soly = subs(redC, x, solx);
soly = double(soly)
soly = 2×1
1.2239 1.2239
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)
solx = 0.0309
soly = subs(redC, x, solx);
soly = double(soly)
soly = 2.5498
% 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)
solx = -2.4325
soly = subs(redC, x, solx);
soly = double(soly)
soly = -0.7651
You can find another 6 intersections using this concept of non-coaxial centers.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by