eolymp
bolt
Try our new interface for solving problems
Problems

Push-To Telescope

Push-To Telescope

Once a \textit{Push-To Telescope} is setup, it tells you where to point the telescope to see a star in its built-in catalogue by giving an \textit{azimuth} (counter-clockwise angle in the base plane of the telescope) and \textit{elevation} (angle above the base plane of the telescope). The telescope is initialized by pointing it at a known star, finding the star in the catalogue and selecting it. This step is repeated with a second known star which is not too close to the first one. The direction of stars in the catalogue is given in \textit{geocentric equatorial coordinates}. The origin is the center of the earth. The positive \textbf{z}-\textit{axis} passes through the North Pole and the \textbf{xy}-\textit{plane} contains the equator The \textbf{x}-\textit{axis} points at the sun at the \textit{spring equinox} (when the sun is in the equatorial plane). The star coordinates are right ascension, \textbf{α}, (angle \textbf{xy}-\textit{plane} counter-clockwise from the \textbf{x}-\textit{axis} in degrees) and declination, \textbf{δ}, (angle above (positive) or below (negative) the \textbf{xy}-\textit{plane}). \includegraphics{https://static.e-olymp.com/content/37/373323f9c91c39f9300f29197b63e8100c7b13d8.jpg} \includegraphics{https://static.e-olymp.com/content/49/49270e28ebc371c9e6e548fe5edf6353526f0ecb.jpg} In this coordinate system, the earth rotates at (\textbf{2}) (\textbf{1.0027379093})/\textbf{86400} radians per second. (Since the earth moves around the sun, it must rotate more than \textbf{360} degrees to get the sun over the same point.) During setup, when you select a star, the system records the time (in seconds since the system was turned on), the azimuth and elevation of the telescope when pointing at the star and the index of the star in the table. After two selections of known stars, the system computes the transformation from geocentric equatorial coordinates to local coordinates. Subsequently, when you select a star to view, the system uses the stars geocentric equatorial coordinates and the current time to compute the azimuth and elevation to point at the star. Write a program to implement the \textit{Push - ToTelescope}. Since the telescope coordinate system rotates with the earth, it may be useful to use a rotating \textit{geocentric equatorial coordinate} system for star coordinates. This system aligns with geocentric equatorial coordinates when the system turns on and rotates with the earth thereafter. In this system, the declination, \textbf{δ}, is the same but the right ascension angle changes with time: \textbf{α_rot = α - t * rotation_rate} where \textbf{α_rot} is the right ascension angle in the angle in rotating system (in radians), is the right ascension angle in\textit{geocentric equatorial coordinates} (in radians), \textbf{t} is the time in seconds since the system was turned on and\textbf{rotation_rate} is the earth rotation rate above. \InputFile The first line of input contains two decimal integers separated by a single space. The first integer gives the number, \textbf{S}, of stars in the catalogue (\textbf{0} < \textbf{S} ≤ \textbf{100}) and the second gives the number \textbf{P} of data sets (\textbf{0} < \textbf{P} < \textbf{100}). The next \textbf{S} lines of input are the star table. Each line of the star table consists of a decimal integer and two floating-point values separated by spaces. The integer is the star index and the floating-point values are the right ascension (\textbf{α}) and declination (\textbf{δ}) in degrees. There is one star table, and it is used for all data sets. Each data set should be processed identically and independently using the star table. The \textbf{P} problem data sets follow the star table data. Each data set consists of several lines. The first line of each data set consists of two decimal integers separated by a single space. The first integer is the problem instance number \textbf{N}. The second integer is the number of stars to find \textbf{T}, (\textbf{T} ≤ \textbf{10}) for the data set. The next two lines specify the setup data for the data set. Each setup line consists of two integers followed by two floating-point values. The integers are \textbf{t}, the number of seconds since the system was started and \textbf{I}, the index of the known setup star in the table. The floating-point values are the azimuth and elevation of the star in degrees (in telescospe coordinates). The remaining \textbf{T} lines of input in the data set specify a star the user wants to observa. Each line of input consists of three integers separated by spaces. The first integer is the number of the star to observe (the sub-problem number), the second is the time (in seconds) since the system was startec and the last is the index of the star to observe in the star table. \OutputFile There are several lines of output for each data set. The first line of output contains the data set number, followed by a single space and the number of stars that the user wished to observed (\textbf{T}). For each star that was to be observed, there is one line of output. If the computed elevation is less than zero (the star is below the horizon), the line consists of the star (sub-problem) number followed by a space and the string "\textbf{NOT INVISIBLE}" (without the quotes). Otherwise the line consists of the observed star (sub-problem) number followed by the \textit{azimuth} and elevation in degrees to one decims place.
Time limit 1 second
Memory limit 32 MiB
Input example #1
15 2
1 39.90 -16.70
2 34.65 -52.70
3 76.85 -60.80
4 70.85 19.20
5 95.19 38.80
6 28.12 46.00
7 27.62 -8.20
8 43.17 5.20
9 14.27 -57.20
10 37.62 7.40
11 67.85 -60.40
12 103.47 8.90
13 64.05 -63.10
14 28.10 16.50
15 83.64 -26.40
1 3
20 14 144.70 55.24
73 15 321.36 55.97
1 264 8
2 1121 4
3 2319 9
2 3
39 2 190.46 80.21
73 13 354.21 81.15
1 133 8
2 1846 11
3 2746 5
Output example #1
1 3
1 146.8062 73.0344
2 70.5127 63.7341
3 65.8201 24.2972
2 3
1 133.5127 26.6802
2 7.7289 83.8324
3 NOT VISIBLE