# Code for great circle?

1. Dec 23, 2007

### makc

wonder if anyone have stumbled across ready code for http://mathworld.wolfram.com/GreatCircle.html" - i.e., the code to get from phi1 theta1 to phi2 theta2 on sphere.

Last edited by a moderator: Apr 23, 2017 at 9:42 AM
2. Dec 24, 2007

### Coin

"Code"? In what language?

All you should really need to do is just copy equation (5) from that page, it should work almost verbatim as code in almost any programming language, just remember that $$cos^{-1}$$ becomes for example "acos" in C.

3. Dec 24, 2007

### makc

for starters, eq. 5 gives nothing but distance. what I need is deltas of phi and theta (ideally as a function of t = 0....1). the language could be anything that remotely looks like c (i.e. not lisp). the reason to ask for code is to avoid making bugs that were already made and fixed.

so far, closest to what I am looking for is http://www.google.com.ua/codesearch.../basemap/greatcircle.py&hl=ru&btnG=Поиск+кода, but I'm open for other options :)

Last edited by a moderator: Apr 23, 2017 at 9:43 AM