Commit f4881005 authored by Brandon Reid's avatar Brandon Reid

autosave

parent 37773ebd
......@@ -680,23 +680,109 @@ vector <pair<double, double>> constellationCoordinates () {
}
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;
void viewWindow (vector <pair<double,double>> constellationCoordinates, vector <pair<double,double>> window) {
int inrangeCount = 0;
int coordinateCount = 0;
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;
for(int j = 0; j < (constellationCoordinates.size / 4); j++) {
inrangeCount = 0;
for (int i = 0; i < 4; i++) {
coordinateCount++;
if(((windown.at(0).first) > (constellationCoordinates.at(coordinateCount).first)) && ((windown.at(1).first) < (constellationCoordinates.at(coordinateCount).first))
&& ((windown.at(2).first) > (constellationCoordinates.at(coordinateCount).first)) && ((windown.at(3).first) < (constellationCoordinates.at(coordinateCount).first))
&& ((windown.at(0).second) > (constellationCoordinates.at(coordinateCount).second)) && ((windown.at(1).second) < (constellationCoordinates.at(coordinateCount).second))
&& ((windown.at(2).second) > (constellationCoordinates.at(coordinateCount).second)) && ((windown.at(3).second) < (constellationCoordinates.at(coordinateCount).second))) {
inrangeCount++;
}
}
if (inrangeCount == 4) {
cout << "Constellation" << constellationNamer(coordinateCount) << "is fully in view." << endl
<< "Here is an image." << endl;
constellationOutputter(coordinateCount);
} else if (inrangeCount > 4 && inrangeCount > 0) {
cout << "Constellation" << constellationNamer(coordinateCount) << "is partially in view." << endl
<< "Here is an image." << endl;
constellationOutputter(coordinateCount);
} else {
cout << endl;
}
}
}
string constellationNamer (int index) {
if (index == 3) {
return " Canis Major ";
} else if (index == 7) {
return " Eridanius ";
} else if (index == 11) {
return " Gemini ";
} else if (index == 15) {
return " Orion ";
} else if (index == 19) {
return " Tarus ";
} else if (index == 23) {
return " Bootes ";
} else if (index == 27) {
return " Cancer";
} else if (index == 31) {
return " Leo ";
} else if (index == 35) {
return " Virgo ";
} else if (index == 39) {
return " Aquila ";
} else if (index == 43) {
return " Sagitarius ";
} else if (index == 47) {
return " Scorpius ";
} else if (index == 51) {
return " Capricornus ";
} else if (index == 55) {
return " Pegasus ";
} else if (index == 59) {
return " Pisces ";
} else if (index == 63) {
return " Ursa Minor ";
} else if (index == 67) {
return " Ursa Major ";
}
}
void constellationOutputter (int index) {
Stars a;
if (index == 3) {
a.CanisMajor0();
} else if (index == 7) {
a.Eridanius1();
} else if (index == 11) {
a.Gemini2();
} else if (index == 15) {
a.Orion3();
} else if (index == 19) {
a.Tarus4();
} else if (index == 23) {
a.Bootes5();
} else if (index == 27) {
a.Cancer6();
} else if (index == 31) {
a.Leo7();
} else if (index == 35) {
a.Virgo8();
} else if (index == 39) {
a.Aquila9();
} else if (index == 43) {
a.Sagistarius10();
} else if (index == 47) {
a.Scorpius11()
} else if (index == 51) {
a.Capricornus12();
} else if (index == 55) {
a.Pegasus13();
} else if (index == 59) {
a.Pisces14()
} else if (index == 63) {
a.UrsaMinor15();
} else if (index == 67) {
a.UrsaMajor16();
}
}
......@@ -442,12 +442,8 @@ void Stars::Capricornus12() {
}
}
<<<<<<< HEAD
void Stars::Pegasus13() { //done
=======
void Stars::Pegasus() { //done: coordinates based on pic 11:02pm at 24 degrees
>>>>>>> 4e1ad8624316617b8f087e4405e4375a485173e0
void Stars::Pegasus13() { //done: coordinates based on pic 11:02pm at 24 degrees
for(int row = 0; row < 24; row++) {
for(int col = 0; col < 40; col++) {
......
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