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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:26:34+00:00 2026-05-18T04:26:34+00:00

I’m trying to use the formula from (www.movable-type.co.uk/scripts/latlong.html) to return a destination point giving

  • 0

I’m trying to use the formula from (www.movable-type.co.uk/scripts/latlong.html) to return a destination point giving a starting point, distance and bearing. These are my values:

int radius_km = 6371;
double d = 74.02;
double st_lat = 39.4450;
st_lat = Math.toRadians(st_lat); 
double bearing = 106.1607;
bearing = Math.toRadians(bearing);

double end_lat = Math.asin( Math.sin(st_lat)*Math.cos(d/radius_km) +
          Math.cos(st_lat)*Math.sin(d/radius_km)*Math.cos
          (bearing) );

end_lat = Math.toDegrees(end_lat);

When I enter the d, st_lat and bearing at the website, I get this: 39°33′28″N.
When I use the above code (that I copied from the website) I get this: 39.25679699255662.

I looked around more and somebody said the division may not return the decimal amount, so I replaced the division with:

BigDecimal distance = new BigDecimal("74.02");
BigDecimal strradius = new BigDecimal("6371");
BigDecimal d2 = distance.divide(strradius, 6, RoundingMode.HALF_EVEN);
double d = d2.doubleValue();

and changed the formula to:

end_lat=Math.asin(Math.sin(st_lat)*
 Math.cos(d)+Math.cos(st_lat)*Math.sin(d)*Math.cos(bearing));

The answer I get now is 39.25680143864117.
I’m sure I’m missing something but I’m not able to go through each step of the calculation to see where I’m off at. Does anybody have step-by-step instructions on how to do this? I would greatly appreciate it.
Thanks.

  • 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-18T04:26:34+00:00Added an answer on May 18, 2026 at 4:26 am

    Are you sure you are doing the correct conversion from minutes/seconds to decimals?

    There are 60 minutes in a degree, 60 seconds in a minute. If the starting latitude is 39.4450; assuming that positive means north of the equator. If the bearing of 106.1607 is assumed to be measured from north going clockwise; would mean you are traveling southeast.

    You said the website is telling you the answer is 39°33′28″N, but if I convert this to decimal, that is equal to 39+(33+28/60)/60 = 39.5578. This result is greater than your starting point, i.e., you are traveling southeast, but ending up north of your point.

    I haven’t looked at the math in your code yet, but off hand I would say your problem lies in the conversion from minutes/seconds to decimals and back.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.