Checking given point in circle
19 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Muhammad Aliff Najmi bin Mohammad Remeli
el 31 de Mayo de 2022
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?
0 comentarios
Respuestas (2)
DGM
el 31 de Mayo de 2022
Editada: DGM
el 31 de Mayo de 2022
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
0 comentarios
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!