⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 relellip.m

📁 it is a source code for geodesy
💻 M
字号:
% M-file for calculation of relative ellipse

%Kai Borre 10-25-96
%Copyright (c) by Kai Borre
%$Revision: 1.0 $  $Date: 1997/09/26  $

%    	xA     yA    xB    yB
S = [ 4.10  0.17  4.00 -1.20;   % Numbers from Peter Richardus:
      0.17  4.20  2.10  2.10;   % Project Surveying, page 120
      4.00  2.10  5.60  1.20;
     -1.20  2.10  1.20  6.00];
chol(S(1:2,1:2));
chol(S(3:4,3:4));
chol(S);
[aA, bA, alphaA] = ellaxes(S(1:2,1:2))
[aB, bB, alphaB] = ellaxes(S(3:4,3:4))
[aR, bR, alphaR] = ellaxes([S(1,1)+S(2,2)-2*S(2,1)  ...
                    S(1,2)-S(2,3)-S(1,4)+S(3,4); ...
                    S(1,2)-S(2,3)-S(1,4)+S(3,4)  ...
                    S(3,3)+S(4,4)-2*S(3,4)])
t = linspace(0,2*pi,50);
rotA = [cos(alphaA) -sin(alphaA);sin(alphaA) cos(alphaA)];
plA = [aA*sin(t);bA*cos(t)];
for t = 1:50,
   currentA = rotA*plA(:,t);
   curveA(1:2,t) = currentA;
end

t = linspace(0,2*pi,50);
rotB = [cos(alphaB) -sin(alphaB);sin(alphaB) cos(alphaB)];
plB = [aB*sin(t);bB*cos(t)];
for t = 1:50
   currentB = rotB*plB(:,t);
   curveB(1:2,t) = currentB;
end

t = linspace(0,2*pi,50);
rotR = [cos(alphaR) -sin(alphaR);sin(alphaR) cos(alphaR)];
plR = [aR*sin(t);bR*cos(t)];
for t = 1:50
   currentR = rotR*plR(:,t);
   curveR(1:2,t) = currentR;
end

clf
delete relellip.eps
hold on
axis equal
axis off
plot(curveA(1,1:50)-1, curveA(2,1:50)-.5)
axesaA = rotA*[-aA  aA; 0 0];
axesbA = rotA*[0 0; -bA  bA];
plot(axesaA(1,:)-1, axesaA(2,:)-.5,'--',...
                       axesbA(1,:)-1, axesbA(2,:)-.5,'b--')

plot(curveB(1,1:50)+1, curveB(2,1:50)+.5)
axesaB = rotB*[-aB  aB; 0 0];
axesbB = rotB*[0 0; -bB  bB];
plot(axesaB(1,:)+1, axesaB(2,:)+.5,'--',...
                       axesbB(1,:)+1, axesbB(2,:)+.5,'r--')

plot(curveR(1,1:50), curveR(2,1:50))
axesaR = rotR*[-aR  aR; 0 0];
axesbR = rotR*[0 0; -bR  bR];
plot(axesaR(1,:), axesaR(2,:),'--',...
                              axesbR(1,:), axesbR(2,:),'--')

plot([-1 1],[-.5 .5],'--')
hold off

print relellip -deps
%%%%%%%% end relellip.m  %%%%%%%%%%%%%%%%%%%%%

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -