フィルターのクリア

How to check if a point lies in the sector of a circle?

10 ビュー (過去 30 日間)
Ananya Malik
Ananya Malik 2017 年 10 月 17 日
コメント済み: Aida Jones 2018 年 7 月 6 日
I have a sector defined by the following code.
x0=12;
y0=13;
theta =30;
r=3
a1 = 2*pi*rand; % A random direction
a2 = a1 + theta;
t = linspace(a1,a2);
x = x0 + r*cos(t);
y = y0 + r*sin(t);
plot([x0,x,x0],[y0,y,y0],'k-')
I want to check if a point, say [12.5 11.5] lies within the sector defined. Thanks in advance.
  1 件のコメント
Aida Jones
Aida Jones 2018 年 7 月 6 日
Can you please share the solution. I am also looking for it. Thanks

サインインしてコメントする。

採用された回答

KSSV
KSSV 2017 年 10 月 17 日
YOu should be having a set of points for sector and the points for circle. Use inpolygon to know whether these points lie inside or outside the given circle. Read about inpolygon.
  4 件のコメント
Ananya Malik
Ananya Malik 2017 年 10 月 17 日
Thanks a lot. I got it (y).
KSSV
KSSV 2017 年 10 月 17 日
Thanks is accepting the answer.....;)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by