main.cpp 2.64 KB
Newer Older
Brandon Reid's avatar
Brandon Reid committed
1 2 3
#include <iostream> 
#include "Functions.h"
#include "countries.h"
Brandon Reid's avatar
Brandon Reid committed
4
#include "Algorithm.h"
Brandon Reid's avatar
Brandon Reid committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <vector>
#include <string>
#include <utility>

using namespace std;

int main () {
    //variables
    string monthInput;
    int monthDay = 0;
    int yearInput = 0;
    int hourInput = 0;
    int minuteInput = 0;
    pair <double,double> AltAndAziPair;
    pair <double, double> longAndLatPair;
Brandon Reid's avatar
Brandon Reid committed
20 21
    vector <pair<double,double>> window;
    vector <pair<double,double>> coordinates;
Brandon Reid's avatar
Brandon Reid committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
    
    cout <<  "==============Welcome to the Star-Gazer v 1.0==============" << endl;
    do {
        yearInput = yearPrompt();
        
        monthInput = monthPrompt();
        
        monthDay = dayPrompt(monthInput, yearInput);
        
        hourInput = hourPrompt();
        
        minuteInput = minutePrompt();
        
        AltAndAziPair = altAndAziPair ();
        
        printCities();
        
        longAndLatPair = longAndLat();
        
Brandon Reid's avatar
Brandon Reid committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
        //calculating the julian date
        // cout << "if the date is January 27, 2017 at 5:45:54.6 pm, the julian date function should return 2457781.240208." << endl
        //      << "It actually returns: " << julian(2017, 641.9) << endl;
             
             
        // cout << "if the date is January 1, 2000 at 00:00:00, the GMST date function should return: 6.79519916667." << endl
        //      << "It actually returns: " << GMST(2000, 0) << endl;
        // //converting time and longitude to phi
        /*cout << "if its January 27, 2034, 5:45 pm at a longitude of 49 the, phi should equal 4.65147698949." << endl
             << "Phi actually equals: " << timeToPhi(2034, 641.765166667, 49) << endl;*/
             
        //test the algorithm as a whole
        // pair<double, double> test;
        // test.first = -46;
        // test.second = 89;
        // pair<double,double> horizontal;
        // horizontal.first = 20;
        // horizontal.second = 270;
        pair<double,double> returnValue;
        returnValue = algorithm(641.9, longAndLatPair, AltAndAziPair, 2017);
        cout << "The algorithm function, when its January 27, 2017, at 5:45:54 pm, at a lat and long of -46,89 and when looking at the sky at 20, 270 (in horizontal coordinates), gives: " << endl
             << "Right ascention of: " << returnValue.first << " and a declination of: " << returnValue.second << endl;
             
Brandon Reid's avatar
Brandon Reid committed
64 65 66 67
        window = viewFinder(returnValue);
        coordinates = constellationCoordinates ();
        
        printConstellation(coordinates, window);
Brandon Reid's avatar
Brandon Reid committed
68 69 70 71
            
        } while (false);
        
        
Brandon Reid's avatar
Brandon Reid committed
72 73 74
    //cout << dateToHour(yearInput, monthInput, monthDay, hourInput, minuteInput) << endl;
    return 0; 
}