Re: Conversion between ECEF to local Geodetics datum
- From: "KBH" <KBH@xxxxxxxxxxx>
- Date: Wed, 22 Apr 2009 02:55:55 -0400
I did a google search for my Local Topocentric code and found it at
sci.tech-archive.net:
{Latitude and longitude to ECEF xyz}
{KBH Code}
ra:= 180 / Pi;
a:= 6378137;
ee:= 0.006694379990;
Write(' Input latitude in degrees: ');
ReadLn(lat);
Write(' Input longitude in degrees: ');
ReadLn(lon);
Write(' Input ellipsoidal height in meters: ');
ReadLn(h);
lat:= lat / ra;
lon:= lon / ra;
v:= a / Sqrt(1 - (ee * Sqr(Sin(lat))));
x:= (v + h) * Cos(lat) * Cos(lon);
y:= (v + h) * Cos(lat) * Sin(lon);
z:= ((1 - ee) * v + h) * Sin(lat);
----------------------------------------------------
{ECEF xyz to local topocentric}
{KBH Code}
nr:= (-x * Sin(lat) * Cos(lon)) + (-y * Sin(lat) * Sin(lon)) + (z *
Cos(lat));
ea:= (-x * Sin(lon)) + (y * Cos(lon));
ht:= (x * Cos(lat) * Cos(lon)) + (y * Cos(lat) * Sin(lon)) + (z *
Sin(lat));
{Note the first input is the lat and lon of the first xyz point converted
to local topocentric and then that lat and lon is held in the computations
for all the next xyz input points going to the same local topocentric
system}
-----------------------------------------------------
{ECEF xyz to latitude and longitude}
{KBH Code}
ra:= 180 / Pi;
a:= 6378137;
f:= 0.003352811;
fm:= 1 - f;
ee:= 0.006694379990;
WriteLn;
Write(' Input x coordinate in meters: ');
ReadLn(x);
Write(' Input y coordinate in meters: ');
ReadLn(y);
Write(' Input z coordinate in meters: ');
ReadLn(z);
If (x = 0) Then x:= 0.0001;
{If (x > a) Or (y > a) Then Exit;
If (x < -a) Or (y < -a) Then Exit;}
p:= Sqrt(Sqr(x) + Sqr(y));
r:= Sqrt(Sqr(p) + Sqr(z));
u:= z / p * (fm + (ee * a / r));
u:= ArcTan(u);
lon:= ArcTan(y / x);
la:= (z * fm) + (ee * a * Sin(u) * Sqr(Sin(u)));
lt:= fm * (p - (ee * a * Cos(u) * Sqr(Cos(u))));
lat:= ArcTan(la / lt);
ha:= p * Cos(lat) + (z * Sin(lat));
hb:= a * Sqrt(1 - (ee * Sqr(Sin(lat))));
h:= ha - hb;
lon:= lon * ra;
lat:= lat * ra;
If (x < 0) Then lon:= 180 + lon;
If (lon > 180) Then lon:= lon - 360;
------------------------------------------------------
Okay...I found a source that says that Topocentric Coordinates are often
called EHN (East North Height).
.
- References:
- Conversion between ECEF to local Geodetics datum
- From: Johnson L
- Re: Conversion between ECEF to local Geodetics datum
- From: KBH
- Re: Conversion between ECEF to local Geodetics datum
- From: KBH
- Conversion between ECEF to local Geodetics datum
- Prev by Date: Re: Conversion between ECEF to local Geodetics datum
- Next by Date: Re: Conversion between ECEF to local Geodetics datum
- Previous by thread: Re: Conversion between ECEF to local Geodetics datum
- Next by thread: Re: Conversion between ECEF to local Geodetics datum
- Index(es):
Relevant Pages
|