File Coverage

blib/lib/Astro/Coord/Constellations.pm
Criterion Covered Total %
statement 23 24 95.8
branch 4 4 100.0
condition 9 9 100.0
subroutine 8 8 100.0
pod 2 2 100.0
total 46 47 97.8


line stmt bran cond sub pod time code
1             package Astro::Coord::Constellations;
2              
3 2     2   394954 use 5.006;
  2         18  
4 2     2   36 use strict;
  2         5  
  2         140  
5 2     2   14 use warnings;
  2         5  
  2         101  
6              
7 2     2   597 use Astro::Coord::Precession qw/precess read_coordinates/;
  2         21432  
  2         189  
8              
9             =head1 NAME
10              
11             Astro::Coord::Constellations - Identify the constellation for position (RA, Dec)
12              
13             =head1 VERSION
14              
15             Version 0.01
16              
17             =cut
18              
19             our $VERSION = '0.01';
20              
21 2     2   21 use Exporter qw(import);
  2         4  
  2         4605  
22              
23             our @EXPORT_OK = qw(
24             constellation_for_eq
25             constellations_table
26             );
27              
28             our %EXPORT_TAGS;
29             $EXPORT_TAGS{all} = [@EXPORT_OK];
30              
31              
32             my @boundary_table = (
33             [0.0000, 24.0000, 88.0000, 'UMi'],
34             [8.0000, 14.5000, 86.5000, 'UMi'],
35             [21.0000, 23.0000, 86.1667, 'UMi'],
36             [18.0000, 21.0000, 86.0000, 'UMi'],
37             [0.0000, 8.0000, 85.0000, 'Cep'],
38             [9.1667, 10.6667, 82.0000, 'Cam'],
39             [0.0000, 5.0000, 80.0000, 'Cep'],
40             [10.6667, 14.5000, 80.0000, 'Cam'],
41             [17.5000, 18.0000, 80.0000, 'UMi'],
42             [20.1667, 21.0000, 80.0000, 'Dra'],
43             [0.0000, 3.5083, 77.0000, 'Cep'],
44             [11.5000, 13.5833, 77.0000, 'Cam'],
45             [16.5333, 17.5000, 75.0000, 'UMi'],
46             [20.1667, 20.6667, 75.0000, 'Cep'],
47             [7.9667, 9.1667, 73.5000, 'Cam'],
48             [9.1667, 11.3333, 73.5000, 'Dra'],
49             [13.0000, 16.5333, 70.0000, 'UMi'],
50             [3.1000, 3.4167, 68.0000, 'Cas'],
51             [20.4167, 20.6667, 67.0000, 'Dra'],
52             [11.3333, 12.0000, 66.5000, 'Dra'],
53             [0.0000, 0.3333, 66.0000, 'Cep'],
54             [14.0000, 15.6667, 66.0000, 'UMi'],
55             [23.5833, 24.0000, 66.0000, 'Cep'],
56             [12.0000, 13.5000, 64.0000, 'Dra'],
57             [13.5000, 14.4167, 63.0000, 'Dra'],
58             [23.1667, 23.5833, 63.0000, 'Cep'],
59             [6.1000, 7.0000, 62.0000, 'Cam'],
60             [20.0000, 20.4167, 61.5000, 'Dra'],
61             [20.5367, 20.6000, 60.9167, 'Cep'],
62             [7.0000, 7.9667, 60.0000, 'Cam'],
63             [7.9667, 8.4167, 60.0000, 'UMa'],
64             [19.7667, 20.0000, 59.5000, 'Dra'],
65             [20.0000, 20.5367, 59.5000, 'Cep'],
66             [22.8667, 23.1667, 59.0833, 'Cep'],
67             [0.0000, 2.4333, 58.5000, 'Cas'],
68             [19.4167, 19.7667, 58.0000, 'Dra'],
69             [1.7000, 1.9083, 57.5000, 'Cas'],
70             [2.4333, 3.1000, 57.0000, 'Cas'],
71             [3.1000, 3.1667, 57.0000, 'Cam'],
72             [22.3167, 22.8667, 56.2500, 'Cep'],
73             [5.0000, 6.1000, 56.0000, 'Cam'],
74             [14.0333, 14.4167, 55.5000, 'UMa'],
75             [14.4167, 19.4167, 55.5000, 'Dra'],
76             [3.1667, 3.3333, 55.0000, 'Cam'],
77             [22.1333, 22.3167, 55.0000, 'Cep'],
78             [20.6000, 21.9667, 54.8333, 'Cep'],
79             [0.0000, 1.7000, 54.0000, 'Cas'],
80             [6.1000, 6.5000, 54.0000, 'Lyn'],
81             [12.0833, 13.5000, 53.0000, 'UMa'],
82             [15.2500, 15.7500, 53.0000, 'Dra'],
83             [21.9667, 22.1333, 52.7500, 'Cep'],
84             [3.3333, 5.0000, 52.5000, 'Cam'],
85             [22.8667, 23.3333, 52.5000, 'Cas'],
86             [15.7500, 17.0000, 51.5000, 'Dra'],
87             [2.0417, 2.5167, 50.5000, 'Per'],
88             [17.0000, 18.2333, 50.5000, 'Dra'],
89             [0.0000, 1.3667, 50.0000, 'Cas'],
90             [1.3667, 1.6667, 50.0000, 'Per'],
91             [6.5000, 6.8000, 50.0000, 'Lyn'],
92             [23.3333, 24.0000, 50.0000, 'Cas'],
93             [13.5000, 14.0333, 48.5000, 'UMa'],
94             [0.0000, 1.1167, 48.0000, 'Cas'],
95             [23.5833, 24.0000, 48.0000, 'Cas'],
96             [18.1750, 18.2333, 47.5000, 'Her'],
97             [18.2333, 19.0833, 47.5000, 'Dra'],
98             [19.0833, 19.1667, 47.5000, 'Cyg'],
99             [1.6667, 2.0417, 47.0000, 'Per'],
100             [8.4167, 9.1667, 47.0000, 'UMa'],
101             [0.1667, 0.8667, 46.0000, 'Cas'],
102             [12.0000, 12.0833, 45.0000, 'UMa'],
103             [6.8000, 7.3667, 44.5000, 'Lyn'],
104             [21.9083, 21.9667, 44.0000, 'Cyg'],
105             [21.8750, 21.9083, 43.7500, 'Cyg'],
106             [19.1667, 19.4000, 43.5000, 'Cyg'],
107             [9.1667, 10.1667, 42.0000, 'UMa'],
108             [10.1667, 10.7833, 40.0000, 'UMa'],
109             [15.4333, 15.7500, 40.0000, 'Boo'],
110             [15.7500, 16.3333, 40.0000, 'Her'],
111             [9.2500, 9.5833, 39.7500, 'Lyn'],
112             [0.0000, 2.5167, 36.7500, 'And'],
113             [2.5167, 2.5667, 36.7500, 'Per'],
114             [19.3583, 19.4000, 36.5000, 'Lyr'],
115             [4.5000, 4.6917, 36.0000, 'Per'],
116             [21.7333, 21.8750, 36.0000, 'Cyg'],
117             [21.8750, 22.0000, 36.0000, 'Lac'],
118             [6.5333, 7.3667, 35.5000, 'Aur'],
119             [7.3667, 7.7500, 35.5000, 'Lyn'],
120             [0.0000, 2.0000, 35.0000, 'And'],
121             [22.0000, 22.8167, 35.0000, 'Lac'],
122             [22.8167, 22.8667, 34.5000, 'Lac'],
123             [22.8667, 23.5000, 34.5000, 'And'],
124             [2.5667, 2.7167, 34.0000, 'Per'],
125             [10.7833, 11.0000, 34.0000, 'UMa'],
126             [12.0000, 12.3333, 34.0000, 'CVn'],
127             [7.7500, 9.2500, 33.5000, 'Lyn'],
128             [9.2500, 9.8833, 33.5000, 'LMi'],
129             [0.7167, 1.4083, 33.0000, 'And'],
130             [15.1833, 15.4333, 33.0000, 'Boo'],
131             [23.5000, 23.7500, 32.0833, 'And'],
132             [12.3333, 13.2500, 32.0000, 'CVn'],
133             [23.7500, 24.0000, 31.3333, 'And'],
134             [13.9583, 14.0333, 30.7500, 'CVn'],
135             [2.4167, 2.7167, 30.6667, 'Tri'],
136             [2.7167, 4.5000, 30.6667, 'Per'],
137             [4.5000, 4.7500, 30.0000, 'Aur'],
138             [18.1750, 19.3583, 30.0000, 'Lyr'],
139             [11.0000, 12.0000, 29.0000, 'UMa'],
140             [19.6667, 20.9167, 29.0000, 'Cyg'],
141             [4.7500, 5.8833, 28.5000, 'Aur'],
142             [9.8833, 10.5000, 28.5000, 'LMi'],
143             [13.2500, 13.9583, 28.5000, 'CVn'],
144             [0.0000, 0.0667, 28.0000, 'And'],
145             [1.4083, 1.6667, 28.0000, 'Tri'],
146             [5.8833, 6.5333, 28.0000, 'Aur'],
147             [7.8833, 8.0000, 28.0000, 'Gem'],
148             [20.9167, 21.7333, 28.0000, 'Cyg'],
149             [19.2583, 19.6667, 27.5000, 'Cyg'],
150             [1.9167, 2.4167, 27.2500, 'Tri'],
151             [16.1667, 16.3333, 27.0000, 'CrB'],
152             [15.0833, 15.1833, 26.0000, 'Boo'],
153             [15.1833, 16.1667, 26.0000, 'CrB'],
154             [18.3667, 18.8667, 26.0000, 'Lyr'],
155             [10.7500, 11.0000, 25.5000, 'LMi'],
156             [18.8667, 19.2583, 25.5000, 'Lyr'],
157             [1.6667, 1.9167, 25.0000, 'Tri'],
158             [0.7167, 0.8500, 23.7500, 'Psc'],
159             [10.5000, 10.7500, 23.5000, 'LMi'],
160             [21.2500, 21.4167, 23.5000, 'Vul'],
161             [5.7000, 5.8833, 22.8333, 'Tau'],
162             [0.0667, 0.1417, 22.0000, 'And'],
163             [15.9167, 16.0333, 22.0000, 'Ser'],
164             [5.8833, 6.2167, 21.5000, 'Gem'],
165             [19.8333, 20.2500, 21.2500, 'Vul'],
166             [18.8667, 19.2500, 21.0833, 'Vul'],
167             [0.1417, 0.8500, 21.0000, 'And'],
168             [20.2500, 20.5667, 20.5000, 'Vul'],
169             [7.8083, 7.8833, 20.0000, 'Gem'],
170             [20.5667, 21.2500, 19.5000, 'Vul'],
171             [19.2500, 19.8333, 19.1667, 'Vul'],
172             [3.2833, 3.3667, 19.0000, 'Ari'],
173             [18.8667, 19.0000, 18.5000, 'Sge'],
174             [5.7000, 5.7667, 18.0000, 'Ori'],
175             [6.2167, 6.3083, 17.5000, 'Gem'],
176             [19.0000, 19.8333, 16.1667, 'Sge'],
177             [4.9667, 5.3333, 16.0000, 'Tau'],
178             [15.9167, 16.0833, 16.0000, 'Her'],
179             [19.8333, 20.2500, 15.7500, 'Sge'],
180             [4.6167, 4.9667, 15.5000, 'Tau'],
181             [5.3333, 5.6000, 15.5000, 'Tau'],
182             [12.8333, 13.5000, 15.0000, 'Com'],
183             [17.2500, 18.2500, 14.3333, 'Her'],
184             [11.8667, 12.8333, 14.0000, 'Com'],
185             [7.5000, 7.8083, 13.5000, 'Gem'],
186             [16.7500, 17.2500, 12.8333, 'Her'],
187             [0.0000, 0.1417, 12.5000, 'Peg'],
188             [5.6000, 5.7667, 12.5000, 'Tau'],
189             [7.0000, 7.5000, 12.5000, 'Gem'],
190             [21.1167, 21.3333, 12.5000, 'Peg'],
191             [6.3083, 6.9333, 12.0000, 'Gem'],
192             [18.2500, 18.8667, 12.0000, 'Her'],
193             [20.8750, 21.0500, 11.8333, 'Del'],
194             [21.0500, 21.1167, 11.8333, 'Peg'],
195             [11.5167, 11.8667, 11.0000, 'Leo'],
196             [6.2417, 6.3083, 10.0000, 'Ori'],
197             [6.9333, 7.0000, 10.0000, 'Gem'],
198             [7.8083, 7.9250, 10.0000, 'Cnc'],
199             [23.8333, 24.0000, 10.0000, 'Peg'],
200             [1.6667, 3.2833, 9.9167, 'Ari'],
201             [20.1417, 20.3000, 8.5000, 'Del'],
202             [13.5000, 15.0833, 8.0000, 'Boo'],
203             [22.7500, 23.8333, 7.5000, 'Peg'],
204             [7.9250, 9.2500, 7.0000, 'Cnc'],
205             [9.2500, 10.7500, 7.0000, 'Leo'],
206             [18.2500, 18.6622, 6.2500, 'Oph'],
207             [18.6622, 18.8667, 6.2500, 'Aql'],
208             [20.8333, 20.8750, 6.0000, 'Del'],
209             [7.0000, 7.0167, 5.5000, 'CMi'],
210             [18.2500, 18.4250, 4.5000, 'Ser'],
211             [16.0833, 16.7500, 4.0000, 'Her'],
212             [18.2500, 18.4250, 3.0000, 'Oph'],
213             [21.4667, 21.6667, 2.7500, 'Peg'],
214             [0.0000, 2.0000, 2.0000, 'Psc'],
215             [18.5833, 18.8667, 2.0000, 'Ser'],
216             [20.3000, 20.8333, 2.0000, 'Del'],
217             [20.8333, 21.3333, 2.0000, 'Equ'],
218             [21.3333, 21.4667, 2.0000, 'Peg'],
219             [22.0000, 22.7500, 2.0000, 'Peg'],
220             [21.6667, 22.0000, 1.7500, 'Peg'],
221             [7.0167, 7.2000, 1.5000, 'CMi'],
222             [3.5833, 4.6167, 0.0000, 'Tau'],
223             [4.6167, 4.6667, 0.0000, 'Ori'],
224             [7.2000, 8.0833, 0.0000, 'CMi'],
225             [14.6667, 15.0833, 0.0000, 'Vir'],
226             [17.8333, 18.2500, 0.0000, 'Oph'],
227             [2.6500, 3.2833, -1.7500, 'Cet'],
228             [3.2833, 3.5833, -1.7500, 'Tau'],
229             [15.0833, 16.2667, -3.2500, 'Ser'],
230             [4.6667, 5.0833, -4.0000, 'Ori'],
231             [5.8333, 6.2417, -4.0000, 'Ori'],
232             [17.8333, 17.9667, -4.0000, 'Ser'],
233             [18.2500, 18.5833, -4.0000, 'Ser'],
234             [18.5833, 18.8667, -4.0000, 'Aql'],
235             [22.7500, 23.8333, -4.0000, 'Psc'],
236             [10.7500, 11.5167, -6.0000, 'Leo'],
237             [11.5167, 11.8333, -6.0000, 'Vir'],
238             [0.0000, 0.3333, -7.0000, 'Psc'],
239             [23.8333, 24.0000, -7.0000, 'Psc'],
240             [14.2500, 14.6667, -8.0000, 'Vir'],
241             [15.9167, 16.2667, -8.0000, 'Oph'],
242             [20.0000, 20.5333, -9.0000, 'Aql'],
243             [21.3333, 21.8667, -9.0000, 'Aqr'],
244             [17.1667, 17.9667, -10.0000, 'Oph'],
245             [5.8333, 8.0833, -11.0000, 'Mon'],
246             [4.9167, 5.0833, -11.0000, 'Eri'],
247             [5.0833, 5.8333, -11.0000, 'Ori'],
248             [8.0833, 8.3667, -11.0000, 'Hya'],
249             [9.5833, 10.7500, -11.0000, 'Sex'],
250             [11.8333, 12.8333, -11.0000, 'Vir'],
251             [17.5833, 17.6667, -11.6667, 'Oph'],
252             [18.8667, 20.0000, -12.0333, 'Aql'],
253             [4.8333, 4.9167, -14.5000, 'Eri'],
254             [20.5333, 21.3333, -15.0000, 'Aqr'],
255             [17.1667, 18.2500, -16.0000, 'Ser'],
256             [18.2500, 18.8667, -16.0000, 'Sct'],
257             [8.3667, 8.5833, -17.0000, 'Hya'],
258             [16.2667, 16.3750, -18.2500, 'Oph'],
259             [8.5833, 9.0833, -19.0000, 'Hya'],
260             [10.7500, 10.8333, -19.0000, 'Crt'],
261             [16.2667, 16.3750, -19.2500, 'Sco'],
262             [15.6667, 15.9167, -20.0000, 'Lib'],
263             [12.5833, 12.8333, -22.0000, 'Crv'],
264             [12.8333, 14.2500, -22.0000, 'Vir'],
265             [9.0833, 9.7500, -24.0000, 'Hya'],
266             [1.6667, 2.6500, -24.3833, 'Cet'],
267             [2.6500, 3.7500, -24.3833, 'Eri'],
268             [10.8333, 11.8333, -24.5000, 'Crt'],
269             [11.8333, 12.5833, -24.5000, 'Crv'],
270             [14.2500, 14.9167, -24.5000, 'Lib'],
271             [16.2667, 16.7500, -24.5833, 'Oph'],
272             [0.0000, 1.6667, -25.5000, 'Cet'],
273             [21.3333, 21.8667, -25.5000, 'Cap'],
274             [21.8667, 23.8333, -25.5000, 'Aqr'],
275             [23.8333, 24.0000, -25.5000, 'Cet'],
276             [9.7500, 10.2500, -26.5000, 'Hya'],
277             [4.7000, 4.8333, -27.2500, 'Eri'],
278             [4.8333, 6.1167, -27.2500, 'Lep'],
279             [20.0000, 21.3333, -28.0000, 'Cap'],
280             [10.2500, 10.5833, -29.1667, 'Hya'],
281             [12.5833, 14.9167, -29.5000, 'Hya'],
282             [14.9167, 15.6667, -29.5000, 'Lib'],
283             [15.6667, 16.0000, -29.5000, 'Sco'],
284             [4.5833, 4.7000, -30.0000, 'Eri'],
285             [16.7500, 17.6000, -30.0000, 'Oph'],
286             [17.6000, 17.8333, -30.0000, 'Sgr'],
287             [10.5833, 10.8333, -31.1667, 'Hya'],
288             [6.1167, 7.3667, -33.0000, 'CMa'],
289             [12.2500, 12.5833, -33.0000, 'Hya'],
290             [10.8333, 12.2500, -35.0000, 'Hya'],
291             [3.5000, 3.7500, -36.0000, 'For'],
292             [8.3667, 9.3667, -36.7500, 'Pyx'],
293             [4.2667, 4.5833, -37.0000, 'Eri'],
294             [17.8333, 19.1667, -37.0000, 'Sgr'],
295             [21.3333, 23.0000, -37.0000, 'PsA'],
296             [23.0000, 23.3333, -37.0000, 'Scl'],
297             [3.0000, 3.5000, -39.5833, 'For'],
298             [9.3667, 11.0000, -39.7500, 'Ant'],
299             [0.0000, 1.6667, -40.0000, 'Scl'],
300             [1.6667, 3.0000, -40.0000, 'For'],
301             [3.8667, 4.2667, -40.0000, 'Eri'],
302             [23.3333, 24.0000, -40.0000, 'Scl'],
303             [14.1667, 14.9167, -42.0000, 'Cen'],
304             [15.6667, 16.0000, -42.0000, 'Lup'],
305             [16.0000, 16.4208, -42.0000, 'Sco'],
306             [4.8333, 5.0000, -43.0000, 'Cae'],
307             [5.0000, 6.5833, -43.0000, 'Col'],
308             [8.0000, 8.3667, -43.0000, 'Pup'],
309             [3.4167, 3.8667, -44.0000, 'Eri'],
310             [16.4208, 17.8333, -45.5000, 'Sco'],
311             [17.8333, 19.1667, -45.5000, 'CrA'],
312             [19.1667, 20.3333, -45.5000, 'Sgr'],
313             [20.3333, 21.3333, -45.5000, 'Mic'],
314             [3.0000, 3.4167, -46.0000, 'Eri'],
315             [4.5000, 4.8333, -46.5000, 'Cae'],
316             [15.3333, 15.6667, -48.0000, 'Lup'],
317             [0.0000, 2.3333, -48.1667, 'Phe'],
318             [2.6667, 3.0000, -49.0000, 'Eri'],
319             [4.0833, 4.2667, -49.0000, 'Hor'],
320             [4.2667, 4.5000, -49.0000, 'Cae'],
321             [21.3333, 22.0000, -50.0000, 'Gru'],
322             [6.0000, 8.0000, -50.7500, 'Pup'],
323             [8.0000, 8.1667, -50.7500, 'Vel'],
324             [2.4167, 2.6667, -51.0000, 'Eri'],
325             [3.8333, 4.0833, -51.0000, 'Hor'],
326             [0.0000, 1.8333, -51.5000, 'Phe'],
327             [6.0000, 6.1667, -52.5000, 'Car'],
328             [8.1667, 8.4500, -53.0000, 'Vel'],
329             [3.5000, 3.8333, -53.1667, 'Hor'],
330             [3.8333, 4.0000, -53.1667, 'Dor'],
331             [0.0000, 1.5833, -53.5000, 'Phe'],
332             [2.1667, 2.4167, -54.0000, 'Eri'],
333             [4.5000, 5.0000, -54.0000, 'Pic'],
334             [15.0500, 15.3333, -54.0000, 'Lup'],
335             [8.4500, 8.8333, -54.5000, 'Vel'],
336             [6.1667, 6.5000, -55.0000, 'Car'],
337             [11.8333, 12.8333, -55.0000, 'Cen'],
338             [14.1667, 15.0500, -55.0000, 'Lup'],
339             [15.0500, 15.3333, -55.0000, 'Nor'],
340             [4.0000, 4.3333, -56.5000, 'Dor'],
341             [8.8333, 11.0000, -56.5000, 'Vel'],
342             [11.0000, 11.2500, -56.5000, 'Cen'],
343             [17.5000, 18.0000, -57.0000, 'Ara'],
344             [18.0000, 20.3333, -57.0000, 'Tel'],
345             [22.0000, 23.3333, -57.0000, 'Gru'],
346             [3.2000, 3.5000, -57.5000, 'Hor'],
347             [5.0000, 5.5000, -57.5000, 'Pic'],
348             [6.5000, 6.8333, -58.0000, 'Car'],
349             [0.0000, 1.3333, -58.5000, 'Phe'],
350             [1.3333, 2.1667, -58.5000, 'Eri'],
351             [23.3333, 24.0000, -58.5000, 'Phe'],
352             [4.3333, 4.5833, -59.0000, 'Dor'],
353             [15.3333, 16.4208, -60.0000, 'Nor'],
354             [20.3333, 21.3333, -60.0000, 'Ind'],
355             [5.5000, 6.0000, -61.0000, 'Pic'],
356             [15.1667, 15.3333, -61.0000, 'Cir'],
357             [16.4208, 16.5833, -61.0000, 'Ara'],
358             [14.9167, 15.1667, -63.5833, 'Cir'],
359             [16.5833, 16.7500, -63.5833, 'Ara'],
360             [6.0000, 6.8333, -64.0000, 'Pic'],
361             [6.8333, 9.0333, -64.0000, 'Car'],
362             [11.2500, 11.8333, -64.0000, 'Cen'],
363             [11.8333, 12.8333, -64.0000, 'Cru'],
364             [12.8333, 14.5333, -64.0000, 'Cen'],
365             [13.5000, 13.6667, -65.0000, 'Cir'],
366             [16.7500, 16.8333, -65.0000, 'Ara'],
367             [2.1667, 3.2000, -67.5000, 'Hor'],
368             [3.2000, 4.5833, -67.5000, 'Ret'],
369             [14.7500, 14.9167, -67.5000, 'Cir'],
370             [16.8333, 17.5000, -67.5000, 'Ara'],
371             [17.5000, 18.0000, -67.5000, 'Pav'],
372             [22.0000, 23.3333, -67.5000, 'Tuc'],
373             [4.5833, 6.5833, -70.0000, 'Dor'],
374             [13.6667, 14.7500, -70.0000, 'Cir'],
375             [14.7500, 17.0000, -70.0000, 'TrA'],
376             [0.0000, 1.3333, -75.0000, 'Tuc'],
377             [3.5000, 4.5833, -75.0000, 'Hyi'],
378             [6.5833, 9.0333, -75.0000, 'Vol'],
379             [9.0333, 11.2500, -75.0000, 'Car'],
380             [11.2500, 13.6667, -75.0000, 'Mus'],
381             [18.0000, 21.3333, -75.0000, 'Pav'],
382             [21.3333, 23.3333, -75.0000, 'Ind'],
383             [23.3333, 24.0000, -75.0000, 'Tuc'],
384             [0.7500, 1.3333, -76.0000, 'Tuc'],
385             [0.0000, 3.5000, -82.5000, 'Hyi'],
386             [7.6667, 13.6667, -82.5000, 'Cha'],
387             [13.6667, 18.0000, -82.5000, 'Aps'],
388             [3.5000, 7.6667, -85.0000, 'Men'],
389             [0.0000, 24.0000, -90.0000, 'Oct']
390             );
391              
392             =head1 SYNOPSIS
393              
394             use Astro::Coord::Constellations qw/constellation_for_eq constellations_table/;
395              
396             my $constellation_abbrev = constellation_for_eq($ra, $dec, $epoch);
397              
398             my %con = constellations_table();
399             my $name = $con{'And'}->[0]; # Andromeda
400             my $genitive = $con{'And'}->[1]; # Andromedae
401              
402             =head1 DESCRIPTION
403              
404             Identify the constellation to which a celestial position (as defined by equatorial
405             coordinates for any epoch) belongs to, according to the IAU constellation boundaries.
406              
407             =head1 METHODS
408              
409             =head2 constellation_for_eq
410              
411             my $constellation = constellation_for_eq($ra, $dec, $epoch);
412              
413             Given equatorial coordinates in hours for Right Ascension C<$ra> and degrees for
414             Declination C<$dec> for epoch C<$epoch> in years AD, the constellation (abbreviation)
415             is returned.
416             You can pass the coordinates as the strings you find in human-readable catalogs,
417             see the function C of L for what
418             formats are supported.
419              
420             =cut
421              
422             sub constellation_for_eq {
423 7     7 1 10654 my ($coord, $epoch) = _convert_coordinates(@_);
424              
425 7         31 $coord = precess($coord, $epoch, 1875);
426              
427 7         672 for (my $i = 0; $i < scalar @boundary_table; $i++) {
428 1868 100 100     5071 return $boundary_table[$i][3]
      100        
429             if $coord->[1] >= $boundary_table[$i][2]
430             && $coord->[0] >= $boundary_table[$i][0]
431             && $coord->[0] < $boundary_table[$i][1];
432             }
433 0         0 return undef;
434             }
435              
436             sub _convert_coordinates {
437 15     15   9019 my ($ra, $dec, $epoch) = @_;
438 15 100 100     82 ($ra, $dec) = @{read_coordinates([$ra, $dec])}
  11         57  
439             if defined $ra && defined $dec;
440 15         502 return ([$ra, $dec], $epoch);
441             }
442              
443             =head1 UTILITY FUNCTIONS
444              
445             =head2 constellations_table
446              
447             my %con = constellations_table();
448              
449             $con{UMi}; # ['Ursa Minor', 'Ursa Minoris']
450              
451             Returns a Perl hash with constellation abbreviations as keys and arrayrefs with
452             the constellation name and genitive.
453              
454             =cut
455              
456             sub constellations_table {
457             return (
458 1     1 1 3509 And => ['Andromeda', 'Andromedae'],
459             Ant => ['Antlia', 'Antliae'],
460             Aps => ['Apus', 'Apodis'],
461             Aql => ['Aquila', 'Aquilae'],
462             Aqr => ['Aquarius', 'Aquarii'],
463             Ara => ['Ara', 'Arae'],
464             Ari => ['Aries', 'Arietis'],
465             Aur => ['Auriga', 'Aurigae'],
466             Boo => ["Bo\x{00f6}tes", "Bo\x{00f6}tis"],
467             CMa => ['Canis Major', 'Canis Majoris'],
468             CMi => ['Canis Minor', 'Canis Minoris'],
469             CVn => ['Canes Venatici', 'Canum Venaticorum'],
470             Cae => ['Caelum', 'Caeli'],
471             Cam => ['Camelopardalis', 'Camelopardalis'],
472             Cap => ['Capricornus', 'Capricorni'],
473             Car => ['Carina', 'Carinae'],
474             Cas => ['Cassiopeia', 'Cassiopeiae'],
475             Cen => ['Centaurus', 'Centauri'],
476             Cep => ['Cepheus', 'Cephei'],
477             Cet => ['Cetus', 'Ceti'],
478             Cha => ['Chamaeleon', 'Chamaeleontis'],
479             Cir => ['Circinus', 'Circini'],
480             Cnc => ['Cancer', 'Cancri'],
481             Col => ['Columba', 'Columbae'],
482             Com => ['Coma Berenices', 'Comae Berenices'],
483             CrA => ['Corona Australis', 'Coronae Australis'],
484             CrB => ['Corona Borealis', 'Coronae Borealis'],
485             Crt => ['Crater', 'Crateris'],
486             Cru => ['Crux', 'Crucis'],
487             Crv => ['Corvus', 'Corvi'],
488             Cyg => ['Cygnus', 'Cygni'],
489             Del => ['Delphinus', 'Delphini'],
490             Dor => ['Dorado', 'Doradus'],
491             Dra => ['Draco', 'Draconis'],
492             Equ => ['Equuleus', 'Equulei'],
493             Eri => ['Eridanus', 'Eridani'],
494             For => ['Fornax', 'Fornacis'],
495             Gem => ['Gemini', 'Geminorum'],
496             Gru => ['Grus', 'Gruis'],
497             Her => ['Hercules', 'Herculis'],
498             Hor => ['Horologium', 'Horologii'],
499             Hya => ['Hydra', 'Hydrae'],
500             Hyi => ['Hydrus', 'Hydri'],
501             Ind => ['Indus', 'Indi'],
502             LMi => ['Leo Minor', 'Leonis Minoris'],
503             Lac => ['Lacerta', 'Lacertae'],
504             Leo => ['Leo', 'Leonis'],
505             Lep => ['Lepus', 'Leporis'],
506             Lib => ['Libra', 'Librae'],
507             Lup => ['Lupus', 'Lupi'],
508             Lyn => ['Lynx', 'Lyncis'],
509             Lyr => ['Lyra', 'Lyrae'],
510             Men => ['Mensa', 'Mensae'],
511             Mic => ['Microscopium', 'Microscopii'],
512             Mon => ['Monoceros', 'Monocerotis'],
513             Mus => ['Musca', 'Muscae'],
514             Nor => ['Norma', 'Normae'],
515             Oct => ['Octans', 'Octantis'],
516             Oph => ['Ophiuchus', 'Ophiuchi'],
517             Ori => ['Orion', 'Orionis'],
518             Pav => ['Pavo', 'Pavonis'],
519             Peg => ['Pegasus', 'Pegasi'],
520             Per => ['Perseus', 'Persei'],
521             Phe => ['Phoenix', 'Phoenicis'],
522             Pic => ['Pictor', 'Pictoris'],
523             PsA => ['Piscis Austrinus', 'Piscis Austrini'],
524             Psc => ['Pisces', 'Piscium'],
525             Pup => ['Puppis', 'Puppis'],
526             Pyx => ['Pyxis', 'Pyxidis'],
527             Ret => ['Reticulum', 'Reticuli'],
528             Scl => ['Sculptor', 'Sculptoris'],
529             Sco => ['Scorpius', 'Scorpii'],
530             Sct => ['Scutum', 'Scuti'],
531             Ser => ['Serpens', 'Serpentis'],
532             Sex => ['Sextans', 'Sextantis'],
533             Sge => ['Sagitta', 'Sagittae'],
534             Sgr => ['Sagittarius', 'Sagittarii'],
535             Tau => ['Taurus', 'Tauri'],
536             Tel => ['Telescopium', 'Telescopii'],
537             TrA => ['Triangulum Australe', 'Trianguli Australis'],
538             Tri => ['Triangulum', 'Trianguli'],
539             Tuc => ['Tucana', 'Tucanae'],
540             UMa => ['Ursa Major', 'Ursae Majoris'],
541             UMi => ['Ursa Minor', 'Ursae Minoris'],
542             Vel => ['Vela', 'Velorum'],
543             Vir => ['Virgo', 'Virginis'],
544             Vol => ['Volans', 'Volantis'],
545             Vul => ['Vulpecula', 'Vulpeculae']
546             );
547             }
548              
549             =head1 AUTHOR
550              
551             Dimitrios Kechagias, C<< >>
552              
553             =head1 BUGS
554              
555             Please report any bugs or feature requests to C, or through
556             the web interface at L.
557             You could also raise issues or submit PRs to the github repo below.
558              
559             =head1 GIT
560              
561             L
562              
563             =head1 ACKNOWLEDGEMENTS
564              
565             IAU constellation boundaries from L.
566             Based on the Fortran program CONFND by FO @ CDS (francois@simbad.u-strasbg.fr).
567              
568             =head1 LICENSE AND COPYRIGHT
569              
570             This software is copyright (c) 2021 by Dimitrios Kechagias.
571              
572             This is free software; you can redistribute it and/or modify it under
573             the same terms as the Perl 5 programming language system itself.
574              
575              
576             =cut
577              
578             1;