Ploting Intersection point of three circles
Show older comments
x1=2; y1=8; r1=10;
x2=5; y2=5; r2=12;
x3=4; y3=9; r3=9;
viscircles([x1, y1], r1, 'Color', 'r');
viscircles([x2, y2], r2, 'Color', 'g');
viscircles([x3, y3], r3, 'Color', 'b');
hold on
x=(((x2-x3)*((x2^2-x1^2)+(y2^2-y1^2)+(r1^2-r2^2))-(x1-x2)*((x3^2-x2^2)+(y3^2-y2^2)+(r2^2-r3^2))))/(2*((y1-y2)*(x2-x3)-(y2-y3)*(x1-x2)))
y=(((y2-y3)*((y2^2-y1^2)+(x2^2-x1^2)+(r1^2-r2^2))-(y1-y2)*((y3^2-y2^2)+(x3^2-x2^2)+(r2^2-r3^2))))/(2*((x1-x2)*(y2-y3)-(x2-x3)*(y1-y2)))
plot(x , y,'r*')
I have this code with a mathematical expression to find the intersection point but as we can see the point is not through the circles. Kindly have a look at it or if someone can provide a better expression for this point.
6 Comments
Can you display the mathematical formula for
x=(((x2-x3)*((x2^2-x1^2)+(y2^2-y1^2)+(r1^2-r2^2))-(x1-x2)*((x3^2-x2^2)+(y3^2-y2^2)+(r2^2-r3^2))))/(2*((y1-y2)*(x2-x3)-(y2-y3)*(x1-x2)))
and this one? It will be easier to analyze the math rather than the cramped and cluttered code.
y=(((y2-y3)*((y2^2-y1^2)+(x2^2-x1^2)+(r1^2-r2^2))-(y1-y2)*((y3^2-y2^2)+(x3^2-x2^2)+(r2^2-r3^2))))/(2*((x1-x2)*(y2-y3)-(x2-x3)*(y1-y2)))
Why should three circles have an intersection point ? This would be a fortunate coincidence.
Curious
on 13 Jul 2022
Torsten
on 13 Jul 2022
Look at your three circles. They don't have a point in common.
Curious
on 13 Jul 2022
Accepted Answer
More Answers (1)
Hi @Talha Sami
Didn't change your code except for adding the minus signs and swapping the symbols in the two formulas. See @John D'Errico's explanations.
What exactly do you call this point? Technically, it is not called "Intersection Point" because the three circles do not physically intersect at this point. I have forgotten much about geometry. Perhap it is related to some kind of "Focal Point"?
x1=2; y1=8; r1=10;
x2=5; y2=5; r2=12;
x3=4; y3=9; r3=9;
viscircles([x1, y1], r1, 'Color', 'r');
viscircles([x2, y2], r2, 'Color', 'g');
viscircles([x3, y3], r3, 'Color', 'b');
hold on
y = -(((x2-x3)*((x2^2-x1^2)+(y2^2-y1^2)+(r1^2-r2^2))-(x1-x2)*((x3^2-x2^2)+(y3^2-y2^2)+(r2^2-r3^2))))/(2*((y1-y2)*(x2-x3)-(y2-y3)*(x1-x2)))
x = -(((y2-y3)*((y2^2-y1^2)+(x2^2-x1^2)+(r1^2-r2^2))-(y1-y2)*((y3^2-y2^2)+(x3^2-x2^2)+(r2^2-r3^2))))/(2*((x1-x2)*(y2-y3)-(x2-x3)*(y1-y2)))
plot(x, y, 'r*')
Categories
Find more on Numerical Integration and Differentiation 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!

