Plotting Right Ascension & Declination on Mercator Map
이전 댓글 표시
I'm developing a program to do many different satellite orbit calculations. One of them involves plotting the ground tracks of a given satellite on a mercator (lat & long) map. I have the Right Ascension and Declination angles in a vector called "rad" in the following code. With Right Ascension in the first column, and declination in the second column. The plot is coming out okay, except that it is connecting the groundtrack line when the right ascension (width) resets from 360 to 0. I can't quite figure out how to plot the data without connecting the line when the right ascension resets to 0 degrees from 360.
rad(:,1) ranges from 0 to 360 (right ascension) rad(:,2) ranges from -90 to 90 (declination)
earth = imread('ImageOfEARTH');
hold on
F = earth(end:-1:1,:,:);
image([0 360],[-90 90],F)
plot(rad(:,1),rad(:,2),'red');
axis([0,360,-90,90])
daspect([1 1 1]);
This code outputs the following plot:

See how that line is connected through the middle? I need to eliminate that.
Thanks!
-Brandon
채택된 답변
추가 답변 (1개)
Chad Greene
2015년 11월 30일
As Star Strider mentioned, you can add a NaN where it wraps around. A faster and possibly less visually appealing way is to plot red dots instead of a red line:
plot(rad(:,1),rad(:,2),'r.');
A note unrelated to your question: Your map isn't actually a Mercator map. It's simply unprojected geographic coordinates where you've given all degrees longitude and latitude equal size. Mercator projections make Greenland appear larger than Africa.
카테고리
도움말 센터 및 File Exchange에서 Reference Applications에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
