Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 151809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:30:40+00:00 2026-05-11T09:30:40+00:00

I have got two WGS84 coordinates, latitude and longitude in degrees. These points are

  • 0

I have got two WGS84 coordinates, latitude and longitude in degrees. These points are rather close together, e.g. only one metre apart.

Is there an easy way to calculate the azimuth of the line between these points, that is, the angle to north?

The naive approach would be to assume a Cartesian coordinate system (because these points are so close together) and just use

sin(a) = abs(L2-L1) / sqrt(sqr(L2-L1) + sqr(B2-B1))

a = azimuth L1, L2 = longitude B1, B2 = latitude

The error will be larger as the coordinates move away from the equator because there the distance between two longitudinal degrees becomes increasingly smaller than the one between two latitudinal degrees (which remains constant).

I found some quite complex formulas which I don’t really want to implement because they seem to be overkill for points that are that close together and I don’t need very high precision (two decimals are enough, one is probably fine either since there are other factors that reduce precision anyway, like the one the GPS returns).

Maybe I could just determine an approximate longitudinal correction factor depending on latitude and use somthing like this:

sin(a) = abs(L2*f-L1*f) / sqrt(sqr(L2*f-L1*f) + sqr(B2-B1))

where f is the correction factor

Any hints?

(I don’t want to use any libraries for this, especially not ones that require runtime licenses. Any MPLed Delphi Source would be great.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:30:41+00:00Added an answer on May 11, 2026 at 9:30 am

    The formulas that you refer to in the text are to calculate the great circle distance between 2 points. Here’s how I calculate the angle between points:

    uses Math, ...; ...  const   cNO_ANGLE=-999;  ...  function getAngleBetweenPoints(X1,Y1,X2,Y2:double):double; var   dx,dy:double; begin   dx := X2 - X1;   dy := Y2 - Y1;    if (dx > 0) then  result := (Pi*0.5) - ArcTan(dy/dx)   else   if (dx < 0) then  result := (Pi*1.5) - ArcTan(dy/dx)   else   if (dy > 0) then  result := 0                          else   if (dy < 0) then  result := Pi                         else                     result := cNO_ANGLE; // the 2 points are equal    result := RadToDeg(result); end; 
    • Remember to handle the situation where 2 points are equal (check if the result equals cNO_ANGLE, or modify the function to throw an exception);

    • This function assumes that you’re on a flat surface. With the small distances that you’ve mentioned this is all fine, but if you’re going to be calculating the heading between cities all over the world you might want to look into something that takes the shape of the earth in count;

    • It’s best to provide this function with coordinates that are already mapped to a flat surface. You could feed WGS84 Latitude directly into Y (and lon into X) to get a rough approximation though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got two Activities. In one I calculate some things and therefore I have
I have got as follows: use constant ABC => ('one', 'two', 'three'); and I
here's what i have got two box one win 2003 server IIS6 another one
Is it possible to paqckage multiple rpms into one file. I have got two
I have got two models, seen below, and am trying to insert one of
I have got two images one that i want to display on the top
I have got two movieclips on the main timeline. First one is envelope_mc and
I've got two date pickers in one form. They have different id's so this
I have got two similar FB apps i am working on. The one works,
I have got two timevalues in the format: %H%M%S (E.G.161500) These values are text-based

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.