1
$\begingroup$

First off, let me say that I'm not a Mathematical wizard. Be easy on me :)

I am looking to draw a subsection of space using OpenGL on the iPhone. I have a star's RA and Dec and am needing to somehow calculate a set of cartesian coordinates based on those values.

My research has led me to believe that I'm needing to run the RA/Dec through a projection algorithm to accurately plot these "points" on a grid. Is this true? If so, I have been suggested to use the "Azimuthal equidistant projection."

Unfortunately, I don't understand all the greek lettering and where my RA/Dec fits in those equations. Am I way off in left field here?

Update

Here is a function I crafted using the information over at: http://www.projectrho.com/smap03.html

/** * Converts Right-Ascension, Declination, and Distance to Cartesian Coordinates * * DEC should be passed in as decimal degrees (0-360) * RA should be passed in as decimal hours (0-24) * Distance should be passed in as parsecs. To convert parsecs to light-years, multiply by 3.262 * * @author Jesse Bunch */ +(CartesianCoords *) ConvertSpehericalToCartesianWithRA: (double)dblRA DEC: (double)dblDEC DIST: (double)dblDIST {      CartesianCoords *objCartesian = [[[CartesianCoords alloc] init] autorelease];      double dblPHI, dblTHETA, dblRHO, dblRVECT;      dblPHI = [AstroUtils ConvertDegreesToRadians: (dblRA * 15)];     dblTHETA = [AstroUtils ConvertDegreesToRadians: dblDEC];     dblRHO = dblDIST;     dblRVECT = dblRHO * cos(dblTHETA);      objCartesian.X = dblRVECT * cos(dblPHI);     objCartesian.Y = dblRVECT * sin(dblPHI);     objCartesian.Z = dblRHO * sin(dblTHETA);      return objCartesian;   } 

http://www.projectrho.com/smap03.html

1 Answers 1

3

RA is like longitude. But it is usually written in terms of hours, minutes and seconds. 24 hours is equivalent to 2 $\pi$ radians. RA=12:24:30 is 12 hours, 24 minutes, 30 seconds. To convert to radians 2$\pi$ * ((12hours/24) + 24minutes/24/60 + 30seconds/24/60/60).

DEC is like latitude. It is usually written in terms of degrees minutes and seconds. It goes from +90 (north pole) to -90 degrees (south pole). 180 degrees is equivalent to $\pi$ radians. DEC= -15:30:10 is -15 degrees, 30 minutes, 10 seconds.

After you convert the two angles to radians then you just have two angles like $\phi, \theta$ in spherical coordinates. You can project into 2D however you want but if you need a star field that is small then typically you don't bother with any projection and just plot as if RA and DEC were cartesian (multiplying the RA by cosine of the dec though to take into account that a second in RA is bigger on the equator than at the north pole).

It's not as bad as it sounds. The only really bizarre thing is that East and West are flipped compared to an earth type map. If you get used to reading sky maps you will have to be careful about this afterwards! (Looking up is different than looking down).

It might also be useful for you to know that RA=12 hours is up in the night sky in March and RA=18h up in June, RA=0h up in Sept and RA=6h up in Dec (set with the equinox). And if you are in the northern hemisphere you can't see things in the sky that have very negative DECs.

  • 0
    Thanks, @Alice. Your time is much appreciated.2011-07-22