Find all the grid points that are inside of the circle

6 次查看(过去 30 天)
I have my radius being between 1 and 10 and my angle from 0 to 2pi. I defined an uniform rectangular grid with 10 points (10 by 10) and I want to find how many points fall into the circle. Thanks a lot.

采纳的回答

Star Strider
Star Strider 2021-4-22
Use the inpolygon function.
  2 个评论
Marina Markaki
Marina Markaki 2021-4-27
But I want the points located inside or on edge of a cricle not a polygonal region. Is this going to work?
Star Strider
Star Strider 2021-4-27
The inpolygon function can output the points in or on the polygon.
A polygon does not havve any defined shape, other than being a closed boundary, so a circle is a polygon.
It will work. (Since this appears to me to be homework, I did not post the code I wrote to check it to be certain that it does.)
.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Elementary Polygons 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by