With Azimuth and Elevation of a satellite, how to plot the location of the satellite marked with a blue X in the picture?

조회 수: 2 (최근 30일)
Using elevation and azimuth data (which are in degrees), how to plot the location of the satellite marked with a cross? The human in the middle of the plot marks the receiver.

답변 (1개)

darova
darova 2019년 10월 10일
Just use built-in function sph2cart
[X,Y,Z] = sph2cart(az,el,r);
plot3(0,0,0,'^r') % human
hold on
plot3(X,Y,Z,'xb') % blue cross
hold off
  댓글 수: 2
Samantha Sim
Samantha Sim 2019년 10월 10일
Thank you for helping with my queries. May I check how to use this? So for example, my azimuth is 108 degrees and elevation is 20.4 degrees. So I used deg2rad() to convert those two parameters to radians and store it in az and el respectively. Then, what do I do with r?
az = deg2rad(108);
el = deg2rad(20.5);
r = 1; %I'm not sure what values to put into this variable
[X,Y,Z] = sph2cart(az,el,r);
plot3(0,0,0,'^r') % human
hold on
plot3(X,Y,Z,'xb') % blue cross
hold off
I ran the program above and I got the figure belowCapture.JPG
Also, do you know how to label the N,E,S,W and plot the axis on the x,y surface such that the center of that surface is where the human will be? Thank you so much
darova
darova 2019년 10월 10일
Some examples
t = linspace(0,2*pi,40);
r = linspace(0,1,10);
[T,R] = meshgrid(t,r);
[X,Y] = pol2cart(T,R);
h = surf(X,Y,X*0); % flat surface
hold on
set(h,'FaceColor','g')
set(h,'EdgeColor',[1 1 1]/2)
p = linspace(0,pi/2,20);
[T,P] = meshgrid(t,p);
[X,Y,Z] = sph2cart(T,P,1);
h = surf(X,Y,Z); % half of a sphere
set(h,'FaceColor','none')
set(h,'EdgeColor',[1 1 1]/1.2)
text(1.2,0,'N') % north?
text(0,-1.2,'E') % easth?
hold off
axis equal
xlim([-1 1]*1.5)
ylim([-1 1]*1.5)
You can draw arc using plot3()

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

카테고리

Help CenterFile Exchange에서 Reference Applications에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by