Calculation of the distance between 2 coordinates of GPS in meters


Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Dec 2006
    Location
    Brasil, Sao Paulo, Campinas
    Posts
    54

    Default Calculation of the distance between 2 coordinates of GPS in meters

    Hello,

    I have a project using a GPS module in my car e now I want to improve it adding a new option... I want to know if I am near of some known poitns as radars of speeds of the roads then I thought about calculating in the distance between known LA/LON of the current LAT/LON and to test if this value is greater that one determined ray, for example 30 meters.
    As I want I covered an area relatively small I I thought about transforming degree, minute and seconds of the coordinates format of my gps ('$GPRMC,151805.812,A,2241.6835,S,04700.3015,W,0.0 0,,131206,,*1F ) in degrees and then to find the difference using the theorem of pitagoras: square shaped root of x^2+y^2, where x is lat1-lat2 and y is long1-long2. I have all datas in arrays (Lat var byte[9]: Lon var byte[10]).
    To convert I think it: GRAUs = GRAUS+(MIN/60)+((.mmmm*60)/3600). Finally I multiply the value in degrees of the difference of the 2 coordinates for the value of 111120 meters (ray of the planet in the Equator), to only have an approach value. I also can search the accurate value of a degree in my region!
    Somebody can help with some algorithm to only decide this problem using word and byte variables?

    Thanks

    Pimentel
    Last edited by Pimentel; - 26th June 2009 at 22:59.

Similar Threads

  1. GPS decoding problems
    By vladimir059@hot in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 25th February 2012, 10:57
  2. GPS $GPRMC to PIC16F684. Need help with SERIN2
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th November 2009, 09:47
  3. Optimizing DIV
    By skimask in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 22nd September 2008, 04:58
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. GPS waypoint distance in Km
    By Art in forum Code Examples
    Replies: 1
    Last Post: - 28th August 2005, 01:59

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts