フィルターのクリア

How can i find the intersection between circle(function) and line(function) ?

5 ビュー (過去 30 日間)
Kihun Moon
Kihun Moon 2018 年 5 月 3 日
編集済み: KSSV 2018 年 5 月 3 日
I want to find intersection point between circle and line, but there are many line in my problem.(the number of circle is one) so there are many intersection points. How can i solve this problem effectively ?

回答 (2 件)

Yuvaraj Venkataswamy
Yuvaraj Venkataswamy 2018 年 5 月 3 日
編集済み: KSSV 2018 年 5 月 3 日

KSSV
KSSV 2018 年 5 月 3 日
Use InterX function from file exchange. Use this link to download the function: https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections?focused=5165138&tab=function
% circle
th = linspace(0,2*pi) ;
x1 = cos(th) ;
y1 = sin(th) ;
L1 = [x1 ; y1] ;
% line
x2 = rand(1,2) ;
y2= rand(1,2) ;
L2 = [x2 ; y2] ;
figure
hold on
plot(x1,y1,'b') ;
plot(x2,y2,'r') ;
P = InterX(L1,L2) ;
plot(P(1),P(2),'*r') ;

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by