Explanation sought concerning gps semicircles.

Discussion in 'General GPS Discussion' started by Peter Hamilton-Scott, Sep 24, 2003.

  1. Looking at the Garmin developers api it mentions that all positions
    returned by their gps devices are represented internally as a number
    of semicircles. For example latitude N51.7.0 is represented internally
    as 609843842 semicircles. To convert this into d.m.s you'd convert it
    with this, dms=semicircles*(180/2^31) and the math is correct.

    Questions that puzzle me are...

    Why semicircles? Why not circles, or rectangles, or triangles? What is
    so intrinsically flawed with a circle that only half of it will do or
    is necessary?

    I just find this semicircle concept a bit weird but there is obviously
    a good reason for it. Can anyone explain?


    Peter Hamilton-Scott, Sep 24, 2003
    1. Advertisements

  2. Peter Hamilton-Scott

    Snay Guest

    I haven't even seen the API you mentioned but it seems that the term
    semicircle means simply 180 degrees. In other words, the used unit is a
    fraction (1/2^31) of 180°. When you multiply the number of such units by the
    conversion factor of (180/2^31), you get the measurement in degrees.
    Snay, Sep 24, 2003
    1. Advertisements

  3. Peter Hamilton-Scott

    Hal Mueller Guest

    The mapping Garmin uses (180 degrees to 2^31 semicircles) allows them
    to use a standard 32 bit unsigned integer to represent the full 360
    degrees of longitude. Thus you get the maximum precision that 32 bits
    allows you (about double what you'd get from a floating point value),
    and they still get to use integer arithmetic instead of floating point
    on the internal processor. Pretty cool design decision, actually.

    Hal Mueller, Sep 24, 2003
  4. Peter Hamilton-Scott

    Colin Guest

    You can also move seamlessly across the 180 meridian, since the 32 bit
    value overflows to produce the correct result. You do have to be
    careful with comparisons across the 180 meridian though, using
    "(a-b)<0" rather than "a<b".
    - Colin.
    Colin, Sep 24, 2003
  5. Hal

    Nice answer. I can now appreciate why they use it, cool, like you say.
    I like your lil test program you wrote using the api. Works well!.
    Peter Hamilton-Scott, Sep 25, 2003
  6. Peter Hamilton-Scott

    Cherrie Guest

    You are one smart mofo.

    Cherrie, Sep 26, 2003
    1. Advertisements

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.