In the following example,
lla = eci2lla([-6.07 -1.28 0.66]*1e6,[2010 1 17 10 20 36])
lla = 1×3
1.0e+05 * 0.0001 -0.0008 -1.3940
How do you end up with a negative altitude?
The altitude should be approximately 312000 m.

댓글 수: 4

Dyuman Joshi
Dyuman Joshi 2023년 11월 7일
Though it is not specified in the documentation of eci2lla about this, but I presume that the altitude is measured from sea-level.
Going under it would give a negative value.
Derrick Early
Derrick Early 2023년 11월 7일
The example should yield a positive altitude.
Dyuman Joshi
Dyuman Joshi 2023년 11월 7일
"The example should yield a positive altitude."
Why? Did you calculate the values by hand and compare?
Derrick Early
Derrick Early 2023년 11월 7일
Oops. I made an error on computing the vector normal. I used
sqrt(sum([-6.07 -1.28 0.66]*1e6).^2)
Instead of
sqrt(sum(([-6.07 -1.28 0.66]*1e6).^2))

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

 채택된 답변

Les Beckham
Les Beckham 2023년 11월 7일
편집: Les Beckham 2023년 11월 7일

0 개 추천

lla = eci2lla([-6.07 -1.28 0.66]*1e6,[2010 1 17 10 20 36]);
lat = lla(1)
lat = 6.0574
lon = lla(2)
lon = -79.8476
So, this point is slightly above the Equator (by about 6 degrees)
dist = vecnorm([-6.07 -1.28 0.66]*1e6) % distance of this point from the center of the Earth
dist = 6.2385e+06
equatorialRadius = 6378e3;
dist - equatorialRadius
ans = -1.3950e+05
alt = lla(3)
alt = -1.3940e+05
So this point is beneath the surface of the Earth by about 140 kilometers (negative altitude).

댓글 수: 2

Derrick Early
Derrick Early 2023년 11월 7일
Thank you! I messed up on computing the vector magnitude.
Les Beckham
Les Beckham 2023년 11월 7일
You are quite welcome.

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

추가 답변 (0개)

제품

릴리스

R2023b

태그

질문:

2023년 11월 7일

댓글:

2023년 11월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by