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

  • SEARCH
  • Home
  • 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 6154377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:15:11+00:00 2026-05-23T20:15:11+00:00

I do not want any code but want to get reference that how can

  • 0

I do not want any code but want to get reference that how can we find the direction ex.North,South East or West from one location to another location, Where both locations defined by Latitude and Longitudes…

I had followed this Link and see 5th answer but I think It is not as right as I want…

Please if you do have any suggestion then help me to solve my problem.

Thanks in advance !!

  • 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. Editorial Team
    Editorial Team
    2026-05-23T20:15:12+00:00Added an answer on May 23, 2026 at 8:15 pm

    this is just pseudo-code, and is a sample with just strings, you can use a int code (1-8)
    for each direction

            p1_lat=initial_point.getLatitude();
            p1_lng=initial_point.getLongitude();
            p2_lat=final_point.getLatitude();
            p2_lng=final_point.getLongitude();
    
            NSString result=@"";
            NSString result_lat=@"";
            NSString result_lng=@"";
            NSString result_aux=@"";
            if(p1_lat<p2_lat){
                result_lat=@"North";
            }else if(p1_lat>p2_lat){
                result_lat=@"South";
            }
    
            if(p1_lng<p2_lng){
                result_lng=@"East";
            }else if(p1_lng>p2_lng){
                result_lng=@"West";
            }
    
            if(result_lat!=""&&result_lng!=""){
                result_aux="-"
            }
        result=[result_lat stringByAppendingString(result_aux)];
        result=[result stringByAppendingString(result_lng)];
    
    return result;
    

    Edit: “else if” fixed, thanks Mehul, is a copy&paste problem 😛

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

Sidebar

Related Questions

I do not want any code but want to get reference that how can
I do not want any code but want to get reference for MKMapView compass
I want set Listbox background to transparent but not working Is there any idea?
I want DefaultModelBinder not to perform any validation based on DataAnnotations metadata. I'm already
do you know any not strict xpath for java? (I want it to not
My company does not follow any well defined process for software development. I want
I do not want to alienate my users, but having multiple ways to sign
The following code does not want to compile. See the included error message. Code:
I do not want TortoiseSVN to alert me with sounds - e.g. when it
My client does not want to have ftp on the production box (understandable). We

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.