将下列c转化为matlab: Ni = a; Hi = sqrt(X*X + Y*Y + Z*Z) - sqrt(a*b); double Mi_temp = (Z / (sqrt(X*X + Y*Y))) / (1 - e2*Ni / (Ni + Hi)); Mi = atand(Mi_temp, 1); for (int i = 0; i < 100; i++) { double lastMi = Mi, lastNi = Ni; Ni = a / sqrt(1 - e2*sind(lastMi)*sind(lastMi)); Hi = sqrt(X*X + Y*Y) / cosd(lastMi) - lastNi; double Mi_temp = (Z / (sqrt(X*X + Y*Y))) / (1 - e2*Ni / (Ni + Hi)); Mi = atand(Mi_temp, 1); if (abs(lastMi - Mi) < 0.0000000001) { break; } }
时间: 2023-06-19 07:04:08 浏览: 210
Matlab 7 - Function Reference Volume 1 A - E.pdf
5星 · 资源好评率100%
Ni = a;
Hi = sqrt(X*X + Y*Y + Z*Z) - sqrt(a*b);
Mi_temp = (Z / (sqrt(X*X + Y*Y))) / (1 - e2*Ni / (Ni + Hi));
Mi = atand(Mi_temp);
for i = 1:100
lastMi = Mi;
lastNi = Ni;
Ni = a / sqrt(1 - e2*sind(lastMi)*sind(lastMi));
Hi = sqrt(X*X + Y*Y) / cosd(lastMi) - lastNi;
Mi_temp = (Z / (sqrt(X*X + Y*Y))) / (1 - e2*Ni / (Ni + Hi));
Mi = atand(Mi_temp);
if abs(lastMi - Mi) < 0.0000000001
break;
end
end
阅读全文