![img1.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/242982/img1.png)
How do I create some code that will check angles and select the next point to draw a line to based on smallest angle?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I need to create the simplest code that will check the angles between a line connecting one central point and another and a line from the same initial central point to a triplet endpoint. I need the code to be able to select the correct central point to draw a line to based on smallest angle (see attached pics). Attached are the two files that contain the coordinates for the central points (f_points) and the endpoints (Triplets): The files are (1) F_points.mat (2) Triplets.mat
![allpoints.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/242926/allpoints.png)
Below is the same image with lines being created:
![allpoints-with-lines.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/242927/allpoints-with-lines.png)
Below is an image which gives an idea of what is needed:
![angles_from_points.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/242928/angles_from_points.png)
5 件のコメント
darova
2019 年 10 月 17 日
How to find neighboring central points?
This is how looks like searching by distance
![img11.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/243235/img11.png)
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!