# How to compute latitude and longitude of a point at a distance from another point in some direction?

I have the coordinates of a point on Earth and I want to know the coordinates of a point that is at a distance in meters from the first point in an angle in degrees from the north but I haven't found the way to do it.

Does anyone know how to do it?

The Java package net.sf.geographiclib has this capability. It uses the method described in my paper Algorithms for geodesics. Look at the documentation on Direct(double lat1, double lon1, double azi1, double s12). Here's a sample of its use:

``````import java.util.*;
import net.sf.geographiclib.*;
public class Direct {
/**
* Solve the direct geodesic problem.
*
* This program reads in lines with lat1, lon1, azi1, s12 and prints out
* lines with lat2, lon2, azi2 (for the WGS84 ellipsoid).
**********************************************************************/
public static void main(String[] args) {
try {
Scanner in = new Scanner(System.in);
double lat1, lon1, azi1, s12;
while (true) {
lat1 = in.nextDouble(); lon1 = in.nextDouble();
azi1 = in.nextDouble(); s12 = in.nextDouble();
GeodesicData g = Geodesic.WGS84.Direct(lat1, lon1, azi1, s12);
System.out.println(g.lat2 + " " + g.lon2 + " " + g.azi2);
}
}
catch (Exception e) {}
}
}
``````

This is the Vincenty's formulae direct problem, i.e. given an initial point, its azimuth and a geodesic distance calculate the final point. For instance, there's a Python implementation of the direct problem available in the PyGeodesy package.

Example:

``````>>> from pygeodesy.ellipsoidalVincenty import LatLon
>>> p = LatLon(-37.95103, 144.42487)
>>> d = p.destination(54972.271, 306.86816)
>>> print d.lon, d.lat
143.926497668 -37.6528177174
``````
• Thanks. I need to do it in an Android app. Do you know if there is a Java library that has a function like that? Commented May 20, 2017 at 19:48
• It seems that @cffk has a Java working solution here Commented May 22, 2017 at 8:07