Find the nearest point of intersections of circles

2 Ansichten (letzte 30 Tage)
Marek Konopka
Marek Konopka am 26 Jun. 2022
Bearbeitet: Sam Chak am 27 Jun. 2022
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 Kommentare
Matt J
Matt J am 26 Jun. 2022
Why not use mean?
Jan
Jan am 26 Jun. 2022
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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

MJFcoNaN
MJFcoNaN am 27 Jun. 2022
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

Weitere Antworten (1)

Sam Chak
Sam Chak am 27 Jun. 2022
Bearbeitet: Sam Chak am 27 Jun. 2022
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.

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by