Code for Great Circle: Get Phi1 Theta1 to Phi2 Theta2 on Sphere

  • Thread starter Thread starter makc
  • Start date Start date
  • Tags Tags
    Circle Code
AI Thread Summary
The discussion centers on finding ready-made code for calculating the great circle path between two points on a sphere, specifically using the coordinates phi1, theta1 to phi2, theta2. The key reference is equation (5) from the MathWorld page, which provides a formula for distance but does not directly yield the deltas of phi and theta over a parameter t ranging from 0 to 1. The desired code should be in a C-like programming language to minimize potential bugs. A suggested resource is a Python script from the Basemap toolkit, but the user is open to exploring additional options for code that meets their requirements.
makc
Messages
65
Reaction score
0
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:
Technology news on Phys.org
"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.
 
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 , but I'm open for other options :)
 
Last edited by a moderator:
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top