How to create a line around the earth map and then getting the location of a specific point on it?
2 ビュー (過去 30 日間)
古いコメントを表示
How to create a line on the earth map starting from any given point. That line should complete the rotation at any given angle through the origin point of the earth, and then shows the location of any point on that line.
For example, let's see the image attached. The red point is our starting user-defined point. We have three lines (orange with angle alpha, green with angle beta, and pink with angle gamma). How to find the location of the center or middle point of each line?
Thank you so much
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/289971/image.png)
2 件のコメント
採用された回答
darova
2020 年 5 月 4 日
Here is a start:
- draw sphere, draw circle. Pick the point you want
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/290295/image.png)
p = p/norm(p); % 'p' is your point (vector of size 1x3)
v = cross(p,[0 0 1])); % axis of rotation
h = plot(...); % your circle
rotate(h,v,a,[0 0 0]) % 'a' is angle at which circle should be rotated (degrees)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/290296/image.png)
- use copyobj to copy rotated circle and rotate it again by 'point' axis
h1 = copyobj(h);
rotate(h1,p,30,[0 0 0]);
set(h1,'color','r') % change color
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/290297/image.png)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!