Filter löschen
Filter löschen

Using fsolve to find circle intersection

4 Ansichten (letzte 30 Tage)
Erica Dawn Miller
Erica Dawn Miller am 8 Apr. 2021
Beantwortet: Khalid Mahmood am 8 Apr. 2021
Hello, I have to use fsolve to find where these two circles interact. If anyone has any advice as to where to get started, I would greatly appreciate it.
(x-2)^2 + (y-2)^2 =16
(x-5)^2 + (y-6)^2 =2

Antworten (1)

Khalid Mahmood
Khalid Mahmood am 8 Apr. 2021
convert 2 equations into 2 functions F(1),F(2) . This is one way but other ways like F=@x [ eq1; eq2] can also be used.
function call_fSolve
fun=@nonL
x0=[0;0]; %initial values
%Let x(1)=x, x(2)=y;
options = optimoptions('fsolve','Display','iter');
[x,fval] = fsolve(fun,x0,options);
end
function F = nonL(x)
F(1) = (x(1)-2)^2 + (x(2)-2)^2 -16
F(2) = (x(1)-5)^2 + (x(2)-6)^2 -2
end

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by