Commit 208c3553 authored by gabrieldemarmiesse's avatar gabrieldemarmiesse

Put back the great_circle files in the examples/not_in_docs

parent f35173fb
import math
def great_circle(lon1, lat1, lon2, lat2):
radius = 3956 # miles
x = math.pi/180.0
a = (90.0 - lat1)*x
b = (90.0 - lat2)*x
theta = (lon2 - lon1)*x
c = math.acos(math.cos(a)*math.cos(b) + math.sin(a)*math.sin(b)*math.cos(theta))
return radius*c
import math
def great_circle(double lon1, double lat1, double lon2, double lat2):
cdef double radius = 3956 # miles
cdef double x = math.pi/180.0
cdef double a, b, theta, c
a = (90.0 - lat1)*x
b = (90.0 - lat2)*x
theta = (lon2 - lon1)*x
c = math.acos(math.cos(a)*math.cos(b) + math.sin(a)*math.sin(b)*math.cos(theta))
return radius*c
import math
def great_circle(lon1, lat1, lon2, lat2):
radius = 3956 # miles
x = math.pi/180.0
a = (90.0 - lat1)*x
b = (90.0 - lat2)*x
theta = (lon2 - lon1)*x
c = math.acos(math.cos(a)*math.cos(b) + math.sin(a)*math.sin(b)*math.cos(theta))
return radius*c
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment