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

23 views (last 30 days)
I have a sector defined by the following code.
theta =30;
a1 = 2*pi*rand; % A random direction
a2 = a1 + theta;
t = linspace(a1,a2);
x = x0 + r*cos(t);
y = y0 + r*sin(t);
I want to check if a point, say [12.5 11.5] lies within the sector defined. Thanks in advance.
  1 Comment
Aida Jones
Aida Jones on 6 Jul 2018
Can you please share the solution. I am also looking for it. Thanks

Sign in to comment.

Accepted Answer

KSSV on 17 Oct 2017
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.

Sign in to comment.

More Answers (0)


Find more on Resizing and Reshaping Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!