# Calculating coordinates given a reference point and distance

I am using QGIS 3.6 and trying to calculate coordinates (lat&long) from a point given the distance. I have the lat&long for reference point and have the distance from the reference point. Points A, B, and C are reference locations of a road X, Y, and Z are building within a distance from A toward point B How can I get the lat and long for X, Y, Z?

• Don't you need a direction as well? – alphabetasoup Jun 25 at 21:30
• Can I get the direction from point A to B? Cause these buildings are on A to B line – Hoda Rezaei Jun 25 at 21:45
• Oh, so the buildings are on the line that starts at A, goes to B, then C? – alphabetasoup Jun 25 at 22:12

1. Use the points A, B and C to create a line. There are many ways to do this, including:

• use the `points to path` tool, or
• use the `geometry by expression` tool, or
• create a line with three vertices, and edit the vertex coordinates using the `vertex editor`
2. Use the `interpolate point on line` tool to create a point at each specified distance. To create multiple points, there are two options. Choose the one that seems most convenient for your dataset.

• Method one: Run the tool once for each point. This method creates a separate layer for each point. You can merge them into a single layer using the `merge vector layers` tool.
• Method two: Make a duplicate line for every point you want to create (select the line, copy and paste). Add an attribute field called distance. Enter the point distances in this field. Use the distance field for the distance value. 3. Get the lat/long of those points by

• clicking on each point with the Identify tool, or
• use the add geometry attributes tool to add lat/long to the attribute table
• You can also use `interpolate point on line` for step 2 – strythe Jun 25 at 23:52
• @strythe, thank you for the suggestion. I thought there was a tool that did the same as `points along geometry` but allowed a data-defined override for the distance value. – csk Jun 27 at 17:04
• I was hoping there'd be a tool for this too, one which takes a field of distances and a line geometry.I had to write a script to interpolate multiple points without having to duplicate the line. – strythe Jun 28 at 0:11