Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

How to draw star chart like this? I have:

  1. star database with coordinates ( right ascension, declination)
  2. observer coordinates (latitude, longitude)
  3. time of observation I need formula which considered these parameters.
share|improve this question

closed as too broad by karthik, brandizzi, Scimonster, Rudie, T J Aug 20 '14 at 12:15

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs. If this question can be reworded to fit the rules in the help center, please edit the question.

    
What have you tried, or what code is giving you problems? –  jcmeloni Mar 10 '12 at 12:28

1 Answer 1

up vote 2 down vote accepted
  1. stellar database

    • google for:
    • BSC (Bright star catalog) ~10K stars up to +6.5 mag (naked eye)
    • Hipparcos ~118K stars up to +12 mag (telescopes) and also has parallax (3D coordinates) and many more
    • Hipparcos is mine favorite. both can be downloaded freely in ASCII format from many Astornomy server just google ...
  2. planets (bodies)

    • you can compile the orbital parameters needed from many sites
    • you will need all Orbital_elements
    • for example here are some
  3. simulation (compute the position in time)

    • for planets is this just obtaining the efemerides of planets/satellites
    • all is just computing Kepler equation
    • M=E-e*sin(E)
    • where :
    • M is mean angle (as if the planet has circular trajectory and constant speed)
    • E is real angle from ellipse center (with Kepler's law taken into account)
    • you can solve it like this:
    • for (E=M,q=0;q<20;q++) E=M+e*sin(E);
    • now you know E for any M which is all you need
    • just compute the position on ellipse and rotate by inclination ...
    • the M is computed also simply just you need to know the time t0 when planet cross angle 0
    • then M = (t-t0) * dM
    • where dM is rotation around Sun
    • if time is in days then dM is in [rad/day]
    • for Earth it is 2.0*pi/tropical_year
    • this will lead you to all planets global positions (relative to Sun) kepler equation For more information look here How to compute planetary positions
  4. Earth view

    • equatoreal coordinates are relative to Earth
    • so you need to add dayly rotation of Earth to your simulation
    • just create transformation matrix
    • with one axis rotated by 23.5 deg in the right direction
    • and add rotation by this axis
    • also add rotation to your geo location
    • after this translate this matrix to computed Earth\s position
    • and from this is easy to convert all global coordinates to your Earth's view
    • Now plot the data to image/screen what ever

[Notes]

  • be careful what rotation period you use !!!
  • Earth's tropical_year = 365.242195601852 days
  • Earth's day rotation dM = 0.0172021242603194 rad/day
  • day is mean solar day !!! just like Julian date ...
  • always calibrate your data with other software or the real thing ...
  • there are some libs that do all of this out there just google ...
  • to improve accuracy implement nutation,precession and orbital parameters change with time
share|improve this answer

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