Checking given point in circle
이전 댓글 표시
How to write function for checking if a given point (x, y) is within the circle with a centre at (p, q) and radius, r?
답변 (2개)
Star Strider
2022년 5월 31일
0 개 추천
Depending on the context, there are probably more purpose-built tools, but you can do it in a very basic manner just the same.
center = [5 5];
radius = 10;
points = [10 10; 10 15];
isincircle = sum((center-points).^2,2) <= radius^2
카테고리
도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!