How to check if a point lies in the sector of a circle?
14 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!