Determine the percentage of proximity of a point with respect to the theoretical

조회 수: 3(최근 30일)
Alejandro Fernández
Alejandro Fernández 2021년 2월 21일
댓글: Alejandro Fernández 2021년 2월 26일
Hello, I need to calculate the percentage of proximity that has a real point with respect to a theoretical one that is located in the center of a rectangle of 300 mm side by 340 mm wide.
If the real point (shown in red) is just above the black, it should return 100% and as it moves away that value should decrease until it is at least 0%.
Could someone tell me how this could be achieved or what I need to do research on to be able to do this?
  댓글 수: 1
Image Analyst
Image Analyst 2021년 2월 21일
Obviously you can compute the distance between them, but what is "the percentage of proximity"? What's your definition for that?

댓글을 달려면 로그인하십시오.

채택된 답변

SaiDileep Kola
SaiDileep Kola 2021년 2월 26일
You may assume an incircle or excircle and scale the distance with respect to radius of circle can be converted to percentage, you can think of similar approach with some other structure.
  댓글 수: 1
Alejandro Fernández
Alejandro Fernández 2021년 2월 26일
Thank you so much I have solve it with this:
dist = norm(pos_centro-stats(index).Centroid);
square_size = [n/6 m/6];
max_dist = norm([0 0] - square_size./2);
confidence = 100-(dist/max_dist*100);

댓글을 달려면 로그인하십시오.

추가 답변(0개)




Community Treasure Hunt

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

Start Hunting!

Translated by