Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Code for great circle?

  1. Dec 23, 2007 #1
    wonder if anyone have stumbled across ready code for http://mathworld.wolfram.com/GreatCircle.html" [Broken] - i.e., the code to get from phi1 theta1 to phi2 theta2 on sphere.
    Last edited by a moderator: May 3, 2017
  2. jcsd
  3. Dec 24, 2007 #2
    "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 [tex]cos^{-1}[/tex] becomes for example "acos" in C.
  4. Dec 24, 2007 #3
    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?q=basemap-0.9.4%2Flib%2Fmatplotlib%2Ftoolkits%2Fbasemap%2Fgreatcircle.py&hl=ru&btnG=%D0%9F%D0%BE%D0%B8%D1%81%D0%BA+%D0%BA%D0%BE%D0%B4%D0%B0 [Broken], but I'm open for other options :)
    Last edited by a moderator: May 3, 2017
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook