Find all the grid points that are inside of the circle

14 visualizaciones (últimos 30 días)
Marina Markaki
Marina Markaki el 22 de Abr. de 2021
Comentada: Star Strider el 27 de Abr. de 2021
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.

Respuesta aceptada

Star Strider
Star Strider el 22 de Abr. de 2021
Use the inpolygon function.
  2 comentarios
Marina Markaki
Marina Markaki el 27 de Abr. de 2021
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 el 27 de Abr. de 2021
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.)
.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Elementary Polygons en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by