Find all the grid points that are inside of the circle
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Marina Markaki
le 22 Avr 2021
Commenté : Star Strider
le 27 Avr 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.
0 commentaires
Réponse acceptée
Star Strider
le 22 Avr 2021
2 commentaires
Star Strider
le 27 Avr 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.)
.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Elementary Polygons dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!