How to convert satellite coordinates to latitude / longitude?

Discussion in 'GPS Technical Discussion' started by bill smithh, Dec 8, 2010.

  1. bill smithh

    bill smithh

    Joined:
    Dec 8, 2010
    Messages:
    1
    Likes Received:
    0
    Hello.
    I am writing a software program to show the latitude and longitude of a given satellite at a given time.

    I am able to determine the x,y,z coordinate of the satellite using Keplernian elements.
    How do I convert these to latitude / longitude?

    For example:

    X: 2742.55314743
    Y: -6079.67068185
    Z: -326.38672720

    Result would be something like this.
    Lat: 58.4320
    Lon: -64.2344

    any help is appreciated.
     
    bill smithh, Dec 8, 2010
    #1
  2. bill smithh

    noazua

    Joined:
    Jan 3, 2011
    Messages:
    4
    Likes Received:
    0
    I just do not know how you got those lat and lon results.
    I do not get them on the calculator online. (sorry I can not write link here) Google: ECEF to LLA converter.

    I think it is not the results that you should get but lat: 0.529341 and lon:-65.719757

    I write my code (Matlab), you also can look in WIKIPEDIA:

    % ECEF = [x y z] input vector in ECEF coordinates. Units: [meters meters meters]
    % LLA = [lon alt alt] output vector in LLA. Units: [radians radians meters]
    % This function assumes the WGS84 model and geodetic (not geocentric)latitude.

    Code:
    function LLA = ECEF2LLA(ECEF )
    x = ECEF(1);
    y = ECEF(2);
    z = ECEF(3);
    
    a = 6378137;
    e = 8.1819190842622e-2;
    
    b   = sqrt(a^2 * (1 - e^2));
    ep  = sqrt((a^2 - b^2) / b^2);
    p   = sqrt(x^2 + y^2);
    th  = atan2(a * z, b * p);
    lon = atan2(y, x);
    lat = atan((z + ep^2 * b * (sin(th))^3) / (p - e^2 * a * (cos(th))^3));
    N   = a / sqrt(1 - e^2 * (sin(lat))^2);
    alt = p / cos(lat) - N;
    
    k = abs(x) < 1 & abs(y) < 1;
    alt(k) = abs(z(k)) - b;
    
    LLA = [lat,lon,alt];
    
    end
     
    Last edited: Jan 9, 2011
    noazua, Jan 9, 2011
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.
Loading...