1

I have (⋅)p1 and (⋅)p2, two geographic points (wgs84) with latitude, longitude, and altitude.

I need to calculate point (⋅)p3 in a specific distance (in meters) from (⋅)p2 along (⋅)p1 to (⋅)p2.

enter image description here

Any suggestion formula?

Taras
  • 32,823
  • 4
  • 66
  • 137
Mohsen
  • 111
  • 1
  • 1
    You need both of the Problems of Geodesy to solve this. Inverse finds the bearing from p1 to p2, then Forward find the location with p1, bearing and distance. You can calculate it one-off using the US Geodetic Survey web site. (You don't want the formula, because it's a partial differential equation with trig functions out the wazoo.) – Vince Nov 13 '22 at 19:36

1 Answers1

0

If using QGIS, you can use expressions with "Geometry Generator" or "Geometry by expression" - see here for details.

The function extend() extends the start and end of a linestring geometry by a specified amount.

If you already have a line, just use extend([line_geometry], 0, [distance]) to extend it at the second point. If working on a point layer, use this expression:

extend (
    make_line (
        geometry(get_feature_by_id(@layer, 1)),
        geometry(get_feature_by_id(@layer, 2))
    ),
    0,1
)

As your layer seems to be in WGS84, units are in degrees, so no meaningful distance values are possible. First reproject the layer to a geographic CRS apt for measurements in your area of interest - e.g. the local UTM zone.

Taras
  • 32,823
  • 4
  • 66
  • 137
Babel
  • 71,072
  • 14
  • 78
  • 208