Find intersections between equations

Hello! I'd like to know how to find the intersection between 2 equations, symbolically or with solve(). for example, the intersections between a line and a circle: y=-3x+1 , x^2+y^2=16 Thank you!

 採用された回答

Ameer Hamza
Ameer Hamza 2018 年 5 月 27 日

0 投票

For symbolic answer
syms x
y = -3*x + 1;
eq = x^2+y^2==16;
sol = vpasolve(eq)
sol =
3/10 - 159^(1/2)/10
159^(1/2)/10 + 3/10
convert it to double
double(sol)
ans =
-0.9610
1.5610

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

質問済み:

2018 年 5 月 27 日

回答済み:

2018 年 5 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by