Commit 36befffc authored by Brandon Reid's avatar Brandon Reid

autosave

parents c2253278 4e1ad862
......@@ -175,14 +175,12 @@ pair<double,double> altAndAziPair () {
}
double dateToHour (string month, int day, int hour, int minute) { // Converts the date into hours
double dateToHour (string month, int year, int day, int hour, int minute) { // Converts the date into hours
//variables
double totHours = 0;
int monthNum = 0;
if (month == "January") {
if (month == "January") { // For the number of months before each month in order
monthNum = 0;
} else if (month == "February") {
monthNum = 1;
......@@ -207,21 +205,19 @@ double dateToHour (string month, int day, int hour, int minute) { // Converts th
} else {
monthNum = 11;
}
if (month == "January" || month == "March" || month == "May" || month == "July" || month == "August" || month == "October" || month == "December") {
if (month == "January" || month == "March" || month == "May" || month == "July" || month == "August" || month == "October" || month == "December") { //Calculates the amount of hours for the months with 31 days
totHours = (monthNum * 744) + ((day - 1) * 24) + (hour - 1) + (minute / 60);
}
else if (month == "April" || month == "June" || month == "September" || month == "November") {
else if (month == "April" || month == "June" || month == "September" || month == "November") { // Calculates the hours for the months with 30 days
totHours = (monthNum * 720) + ((day - 1) * 24) + (hour - 1) + (minute / 60);
}
else if (month == "February") {
if (isLeap(year)) {
totHours = (monthNum * 696) + ((day - 1) * 24) + (hour - 1) + (minute / 60);
}
} else if (!isLeap(year)) {
totHours = (monthNum * 672) + ((day - 1) * 24) + (hour - 1) + (minute / 60);
}
}
else if (month == "February") {
if (isLeap(year)) { // Takes leap year into consideration and calculates the days in February with 29 days
totHours = (monthNum * 696) + ((day - 1) * 24) + (hour - 1) + (minute / 60);
} else if (!isLeap(year)) { // Calculates when February has 28 days
totHours = (monthNum * 672) + ((day - 1) * 24) + (hour - 1) + (minute / 60);
}
}
return totHours;
}
......@@ -442,6 +438,7 @@ vector <pair<double, double>> viewFinder (pair <double, double> centerPt) { // f
return corners;
}
<<<<<<< HEAD
vector <pair<double, double>> constellationCoordinates () {
vector <pair<double, double>> coordinates;
// Canis Major
......@@ -555,4 +552,27 @@ vector <pair<double, double>> constellationCoordinates () {
pair<double, double> pair8d;
pair8d = make_pair(6.1, -33.0);
coordinates.push_back(pair8d);
}
\ No newline at end of file
}
=======
void viewWindow (vector <pair<double,double>> corners, pair<double,double> constellationCoord) {
pair<double,double> coordinates1;
pair<double,double> coordinates2;
pair<double,double> coordinates3;
pair<double,double> coordinates4;
if(corners.coordinates1.first > constellationCoord.first && corners.coordinates1.second > constellationCoord.second &&
corners.coordinates2.first < constellationCoord.first && corners.coordinates2.second > constellationCoord.second &&
corners.coordinates3.first > constellationCoord.first && corners.coordinates3.second < constellationCoord.second &&
corners.coordinates4.first < constellationCoord.first && corners.coordinates4.second < constellationCoord.second) {
cout << "Constellation is fully in view" << endl;
} else if (corners.coordinates1.first > constellationCoord.first || corners.coordinates1.second > constellationCoord.second ||
corners.coordinates2.first < constellationCoord.first || corners.coordinates2.second > constellationCoord.second ||
corners.coordinates3.first > constellationCoord.first || corners.coordinates3.second < constellationCoord.second ||
corners.coordinates4.first < constellationCoord.first || corners.coordinates4.second < constellationCoord.second) {
cout << "Constellation is partially in view" << endl;
} else {
cout << "Constellation is not in view" << endl;
}
}
>>>>>>> 4e1ad8624316617b8f087e4405e4375a485173e0
......@@ -442,7 +442,11 @@ void Stars::Capricornus12() {
}
}
<<<<<<< HEAD
void Stars::Pegasus13() { //done
=======
void Stars::Pegasus() { //done: coordinates based on pic 11:02pm at 24 degrees
>>>>>>> 4e1ad8624316617b8f087e4405e4375a485173e0
for(int row = 0; row < 24; row++) {
for(int col = 0; col < 40; col++) {
......
......@@ -10,7 +10,9 @@ using namespace std;
int main() {
Stars s;
s.UrsaMinor();
s.Pegasus();
return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment