Finding the intersection of a bunch of circles of different centers and radii, using FSOLVE

2 views (last 30 days)
Write a Matlab routine to find the intersection of a bunch of circles of different centers and radii. You should expect around 5 to 10 circles, and also anticipate that the intersection may not be perfect, we use the data for the 5 circles centers and radii given in the table provided. How am i meant to solve this, we were told to use either fsolve or lsqnonlin, if someone could help me produce a code for this much will be appreciated
  2 Comments
Matt J
Matt J on 1 May 2019
How am i meant to solve this, we were told to use either fsolve or lsqnonlin
If you were told which command to use, isn't the "how" of it already answered?

Sign in to comment.

Answers (1)

darova
darova on 1 May 2019
If circles normally intersect each other they have 2 intersection points
- equation for the first circle
- equation for the second
im1.png
Dont know if fsolve() can find intersection point for this:
m2.png
For example, code for lines intersection using fsolve():
clc, clear, cla
x = [0 4];
k1 = 1;
k2 = 3;
y1 = k1.*x+2;
y2 = k2.*x;
F = @(x) [x(2) - k1*x(1)-2
x(2) - k2*x(1)];
x0 = [0 0];
xx = fsolve(F,x0);
hold on
plot(x,y1)
plot(x,y2)
plot(xx(1),xx(2),'or')
hold off
m1.png
  2 Comments
darova
darova on 2 May 2019
You have 5 circles. If you want to compute intersection of the first two - draw them first to see where they intersect (more or less) for initial guess
clc, clear
t = linspace(0,2*pi,50);
x1 = -7.37 + 7.8*cos(t);
y1 = 7.65 + 7.8*sin(t);
x2 = 3.51 + 5.6*cos(t);
y2 = 1.05 + 5.6*sin(t);
plot(x1,y1,x2,y2)

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!