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 9137627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:07:35+00:00 2026-06-17T09:07:35+00:00

I am working on an application with Spatial data. Here I need to find

  • 0

I am working on an application with Spatial data. Here I need to find the distance from the centroid to a point. Can know how to convert miles to degrees in Java?

  • 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-06-17T09:07:36+00:00Added an answer on June 17, 2026 at 9:07 am

    Final Edit: Look into Great Circle Distance and Geodesics to discover the complexities of what you were really asking in this question. This is admittedly well out of my familiarity with mathematics.

    [Leaving original suggestions in for historical reasons. Though pieces may help you, they will not directly answer your question.]

    See https://stackoverflow.com/a/1253545/1964221 for the answer to this question.

    Latitude: 1 deg = 110.54 km

    Longitude: 1 deg = 111.320*cos(latitude) km

    To go the other direction, I wonder if we can do this(my algebra is rusty):

    Latitude: 1 km = 1 deg / 110.54 km
    Longitude: 1 km = 1 deg / (111.320*cos(latitude) km)

    Application

    Is your distance always strictly East-West or North-South? If so, you should be able to say:

    Integer latTraveledMiles = 100;
    Double latTraveledKM = 100 * 0.621371;
    Double latTraveledDeg = (1 / 110.54) * latTraveledKM;
    

    or

    Double currentLat = 74.0064;
    Integer longTraveledMiles = 100;
    Double longTraveledKM = 100 * 0.621371;
    Double longTraveledDeg = (1 / (111.320 * Math.cos(currentLat))) * longTraveledKM;
    

    More than likely, you will need to know distance in both North-South and East-West directions(and takes this into the realm of "not straight-forward). You could look at the Pythagorean Theorem. You know the "long side" of the triangle(c^2) and can calculate for longitude(a^2) and latitude(b^2).

    You should be able to apply portions of my previous code snippets to figure out
    c = sqrt(a^2 + b^2).

    Good luck.

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

Sidebar

Related Questions

I am working for Application where I need to know what is the STATE
i'm working on an application that lets users search for trips from point A
I have a working application which gets the GPS Long/Lat of from a BlackBerry
I'm working application in C#, .NET. How can I check in DataGridView component if
I have my application working fully on my development machine and storing data all
I'm working on an application that uses a lot of X,Y spatial information. Given
I am working on application in which i have to show iAds continuously. Can
Can I force a running Java application to Garbage Collect from console ? Just
I have an working application. Now I want to change the table names of
I have a working application using python and zeromq and I would like to

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.