[Kstars-devel] KDE/kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Fri Jul 1 08:53:08 CEST 2005


Hello,

As a follow-up, I thought I would record exactly what the 
SkyPoint::constellation() function does, because it's pretty complicated.
Feel free to ignore this if not interested.

Constellation boundaries are stored in the cbound.dat file, as a list of 
"segments", each of which represents the border between exactly two 
constellations.  Each segment consists of two or more points on the sky, plus 
the abbreviated names of the two constellations which the segment delineates.

To identify the constellation which contains a point, we first make a list of 
all segments which bracket the RA of the point.  In other words, draw a line 
straight North and South from the point, and collect all segments which the 
line intersects.

We then further identify the pair of these segments which bracket the point in 
Dec.  i.e., the segment which is nearest to the point, but above it, and the 
segment which is nearest but below.

Now, in most cases, this pair of segments will have one of their two 
constellation names in common: this is the constellation which contains the 
point.  However, there are some "corner cases":

* For points near a pole, there won't be any segments [above|below] the point.
In this case, we identify the next-nearest segment [below|above] the point.  
The nearest segment and next-nearest segment will have one name in common.  
The constellation contining the point is the name attached to the nearest 
segment, which is *NOT* matched in the next-nearest segment.  (Note that we 
can't just adopt "Ursa Minor" or Octans" for the pole regions, because of 
precession, a corner case in the corner case).

* It's possible that *both* names attached to the bracketing segments are in 
common.  This happens when a portion of one constellation is surrounded on 
three sides by a neighboring constellation.  To identify the correct 
constellation in this case, we must again look beyond the bracketing segments 
to the next-nearest segment, either above or below.  This segment will have 
one name in common with the bracketing segment.  The desired constellation is 
the *other* name from the original bracketing pair.

So, this function identifies the constellation containing a given point.  I'm 
thinking about adding a function "bool SkyPoint::inConstellation( QString 
name )", which returns true if the point is contained in a specific 
constellation.  I may be able to make it much faster than constellation(), 
and it would be better suited to the usage in the Observing List wizard.

-- 
KStars: KDE Planetarium
http://edu.kde.org/kstars


More information about the Kstars-devel mailing list