How to find distance from point to a grid line?
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens

I need to calculate the percentage of the circle in each rectangular region. The rectangular regions are meant to be a grid lines. To do so, I need to find the distance from a data point within the circle to each grid line (the three lines from the point in the green region). Is there any way to solve this? I have no idea how to approach this so any help would be great. Thanks!
0 commentaires
Réponses (1)
KSSV
le 17 Mai 2017
Modifié(e) : KSSV
le 17 Mai 2017
Two options:
1. If you have image as the input:
I = imread('mathworksqn.jpg') ;
imshow(I);
axis on
h = imdistline ;
Move the line to the points where you want the distance. This will give you distance.
2. If you have data in hand:
You can calculate the distance using the distance formula on knowing the data points.
If you have data in your hand...then you must be having coordinates of the grid and circle..then you can get the area of the part you want using polyarea, trapz. Read about them.
2 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!