How can i make my esphere (lua "moon in english") rotate in my earth ?

1 回表示 (過去 30 日間)
Ian Samuelsson
Ian Samuelsson 2020 年 9 月 9 日
コメント済み: Rik 2020 年 9 月 14 日
clearvars;
set(0,'defaultTextInterpreter','latex');
set(groot, 'defaultAxesTickLabelInterpreter','latex')
set(groot, 'defaultLegendInterpreter','latex');
oLua = [4;4;4];
esc = 8;
% figure(1);
% xx = [0 0]; yy = [0 0]; zz = [-2*oLua 2*oLua];
% plot3(xx,yy,zz,'LineWidth',2); hold on; grid on;
% plot3(xx,zz,yy,'LineWidth',2);
% plot3(zz,yy,xx,'LineWidth',2);
% xlabel('$x$'); ylabel('$y$'); zlabel('$z$');
rLua = 2;
phi = 0:15:180;
theta = 0:15:360;
[theta,phi] = meshgrid(theta,phi);
LUA(3,25*13) = 0;
X = rLua .* sind(phi) .* cosd(theta);
Y = rLua .* sind(phi) .* sind(theta);
Z = rLua .* cosd(phi);
LUA(3,25*13) = 0; kk = 1;
for ii=1:13
for jj=1:25
LUA(:,kk) = [X(ii,jj);...
Y(ii,jj);...
Z(ii,jj)];
kk = kk + 1;
end
end
LUA = LUA + oLua;
for ang=0:5:360
LUA2 = rotacaoZ(LUA,ang);
scatter3(LUA2(1,:),LUA2(2,:),LUA2(3,:),2);
view([-13.8 24.9]);
axis([-esc esc -esc esc -esc esc]);
drawnow;
end
hold off;
function w = rotacaoZ(v,alpha)
Rot = [cosd(alpha) sind(alpha) 0 ;
-sind(alpha) cosd(alpha) 0 ;
0 0 1 ];
w = Rot * v;
end
  6 件のコメント
Ian Samuelsson
Ian Samuelsson 2020 年 9 月 14 日
i try hard but i can't do it
Rik
Rik 2020 年 9 月 14 日
Ok. What do you expect from me? Help me to help you. Give details about what you tried and why. Explain what specific functions you have trouble with and what specific problems you need help to solve. Currently I can only respond like this:
I try hard to help you, but I can't do it.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeGeodesy and Mapping についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by