필터 지우기
필터 지우기

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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by