0

Is there a way to get of angle of a point data with respect to the North in python? So far I have tried to calculate the forward azimuth using pyproj.

import pyproj
from pyproj import CRS

# lat long in WGS84
lat, long = (10.08079707822896, 48.04090098449795)

geodesic = CRS.from_epsg(4326).get_geod()
fwd_azimuth,back_azimuth,distance = geodesic.inv(long, lat, 0, 90) #Assuming (0,90) as the north

print(fwd_azimuth,back_azimuth,distance)

This gives me -0.0 131.95909901550203 8887174.090127569 as the output. Whatever value I put in place of '0' for the longitude of the 'North', I am getting 0 as the fwd_azimuth. I tried 135W as -45 and 45 as well. Both result to 0 or -0. Am I doing something wrong here?

windcheater
  • 25
  • 1
  • 4
  • 1
    What do you mean by angle of a point data with respect to the North. A point by itself has no direction. Do you mean the direction (azimuth) to a point from a position on earth ? – Ptit Xav Nov 16 '21 at 11:29
  • Yes. I wanted the azimuth to a point from the geographical North. – windcheater Nov 16 '21 at 12:52
  • 1
    Check with [this post](https://stackoverflow.com/questions/54873868/python-calculate-bearing-between-two-lat-long) – Ptit Xav Nov 16 '21 at 13:14

0 Answers0