Take the 2-minute tour ×
Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. It's 100% free, no registration required.

I am developing a C++ program where I'd like to be able to see the Suns direction vector and distance from Earth at a given time, since 2000 Jan 0.0 TDT. The reference frame I want to calculate it is from the Earth, with the up vector running along the axis of the poles.

What I have tried so far has been based off http://www.stjarnhimlen.se/comp/tutorial.html#5, but its not entirely the output I'm after; and I feel I can probably achieve this much easier.

Any ideas? Sorry if this is off-topic.

share|improve this question

1 Answer 1

For stuff like that, JPL NAIF's SPICE toolkit is useful. http://naif.jpl.nasa.gov/naif/ It allows determination of vectors between any heavenly bodies in our solar system, get their orientations, allows for choosing between where a body appears to be due to the finite speed of light vs. where it actually is at the same time, account for leap seconds and so on.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.