Skip to content

Instantly share code, notes, and snippets.

@BrunoCaimar
Created June 7, 2019 17:15
Show Gist options
  • Select an option

  • Save BrunoCaimar/4202116411a7c5f4e566fd051f4ef2da to your computer and use it in GitHub Desktop.

Select an option

Save BrunoCaimar/4202116411a7c5f4e566fd051f4ef2da to your computer and use it in GitHub Desktop.
GetGeographicalRadians
import math
def GetGeographicalRadians(shape):
radian = math.atan2(shape.lastpoint.y - shape.firstpoint.y,
shape.lastpoint.x - shape.firstpoint.x)
if (radian<0):
radian = (radian+math.pi)*(-1)+math.pi
else:
radian=(radian-math.pi)*(-1)+math.pi
return radian
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment