How to find distance from point to a grid line?
1 view (last 30 days)
Show older comments
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 Comments
Answers (1)
KSSV
on 17 May 2017
Edited: KSSV
on 17 May 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 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!