Commit 0059ba13 authored by Walterio Montanez's avatar Walterio Montanez
Browse files

Merge branch 'master' of gitlab.cs.wallawalla.edu:walser/project-3-star-gazing

parents 67814aeb 1241a2bf
......@@ -227,4 +227,218 @@ bool isLeap (int year) { // bool check for leap year
} else {
return false;
}
}
vector <pair<double, double>> viewFinder (pair <double, double> centerPt) { // function that finds the coordinates the corner points of a viewing window
vector <pair<double, double>> corners;
if (centerPt.second > 0) {
if (centerPt.first > 20.125 && centerPt.second < 51) { // done
for(int i = 0; i < 4; i++) {
pair<double, double> pair;
if (i == 0) { // top left point
pair = make_pair((centerPt.first + 3.875) - 24, centerPt.second + 39);
corners.push_back(pair);
} else if (i == 1) { // top right point
pair = make_pair(centerPt.first - 3.875), centerPt.second + 39);
corners.push_back(pair);
} else if (i == 2) { // bottom left point
pair = make_pair((centerPt.first + 3.875) - 24, centerPt.second - 39);
corners.push_back(pair);
} else if (i == 3) { // bottom right point
pair = make_pair(centerPt.first - 3.875), centerPt.second - 39);
corners.push_back(pair);
}
}
} else if (centerPt.first < 3.875 && centerPt.second < 51) { // done
for(int i = 0; i < 4; i++) {
pair<double, double> pair;
if (i == 0) { // top left point
pair = make_pair(centerPt.first + 3.875), centerPt.second + 39);
corners.push_back(pair);
} else if (i == 1) { // top right point
pair = make_pair(24 - (3.875 - centerPt.first), centerPt.second + 39);
corners.push_back(pair);
} else if (i == 2) { // bottom left point
pair = make_pair(centerPt.first + 3.875, centerPt.second - 39);
corners.push_back(pair);
} else if (i == 3) { // bottom right point
pair = make_pair(24 - (3.875 - centerPt.first), centerPt.second - 39);
corners.push_back(pair);
}
}
} else if (centerPt.first > 20.125 && centerPt.second > 51) { // done
for(int i = 0; i < 4; i++) {
pair<double, double> pair;
if (i == 0) { // top left point
pair = make_pair((centerPt.first + 3.875) - 24, -90 + (centerPt.second - 51));
corners.push_back(pair);
} else if (i == 1) { // top right point
pair = make_pair(centerPt.first - 3.875, -90 + (centerPt.second - 51));
corners.push_back(pair);
} else if (i == 2) { // bottom left point
pair = make_pair((centerPt.first + 3.875) - 24, centerPt.second - 39);
corners.push_back(pair);
} else if (i == 3) { // bottom right point
pair = make_pair(centerPt.first - 3.875, centerPt.second - 39);
corners.push_back(pair);
}
}
} else if (centerPt.first < 3.875 && centerPt.second > 51) { // done
for(int i = 0; i < 4; i++) {
pair<double, double> pair;
if (i == 0) { // top left point
pair = make_pair(centerPt.first + 3.875, -90 + (centerPt.second - 51));
corners.push_back(pair);
} else if (i == 1) { // top right point
pair = make_pair(24 - (3.875 - centerPt.first), -90 + (centerPt.second - 51));
corners.push_back(pair);
} else if (i == 2) { // bottom left point
pair = make_pair(centerPt.first + 3.875, centerPt.second - 39);
corners.push_back(pair);
} else if (i == 3) { // bottom right point
pair = make_pair(24 - (3.875 - centerPt.first), centerPt.second - 39);
corners.push_back(pair);
}
}
} else if ((centerPt.first < 20.125 && centerPt.first > 3.875) && centerPt.second > 51) { // done
for(int i = 0; i < 4; i++) {
pair<double, double> pair;
if (i == 0) { // top left point
pair = make_pair(centerPt.first + 3.875, -90 + (centerPt.second - 51));
corners.push_back(pair);
} else if (i == 1) { // top right point
pair = make_pair(centerPt.first - 3.875, -90 + (centerPt.second - 51));
corners.push_back(pair);
} else if (i == 2) { // bottom left point
pair = make_pair(centerPt.first + 3.875, centerPt.second - 39);
corners.push_back(pair);
} else if (i == 3) { // bottom right point
pair = make_pair(centerPt.first - 3.875, centerPt.second - 39);
corners.push_back(pair);
}
}
} else if ((centerPt.first < 20.125 && centerPt.first > 3.875) && centerPt.second < 51) { // done
for(int i = 0; i < 4; i++) {
pair<double, double> pair;
if (i == 0) { // top left point
pair = make_pair(centerPt.first + 3.875, centerPt.second + 39);
corners.push_back(pair);
} else if (i == 1) { // top right point
pair = make_pair(centerPt.first - 3.875, centerPt.second + 51);
corners.push_back(pair);
} else if (i == 2) { // bottom left point
pair = make_pair(centerPt.first + 3.875, centerPt.second - 39);
corners.push_back(pair);
} else if (i == 3) { // bottom right point
pair = make_pair(centerPt.first - 3.875, centerPt.second - 39);
corners.push_back(pair);
}
}
}
} else if (centerPt.second < 0) {
if (centerPt.first > 20.125 && centerPt.second > -51) { // done
for(int i = 0; i < 4; i++) {
pair<double, double> pair;
if (i == 0) { // top left point
pair = make_pair((centerPt.first + 3.875) - 24, centerPt.second + 39);
corners.push_back(pair);
} else if (i == 1) { // top right point
pair = make_pair(centerPt.first - 3.875), centerPt.second + 39);
corners.push_back(pair);
} else if (i == 2) { // bottom left point
pair = make_pair((centerPt.first + 3.875) - 24, centerPt.second - 39);
corners.push_back(pair);
} else if (i == 3) { // bottom right point
pair = make_pair(centerPt.first - 3.875), centerPt.second - 39);
corners.push_back(pair);
}
}
} else if (centerPt.first < 3.875 && centerPt.second > -51) { // done
for(int i = 0; i < 4; i++) {
pair<double, double> pair;
if (i == 0) { // top left point
pair = make_pair(centerPt.first + 3.875), centerPt.second + 39);
corners.push_back(pair);
} else if (i == 1) { // top right point
pair = make_pair(24 - (3.875 - centerPt.first), centerPt.second + 39);
corners.push_back(pair);
} else if (i == 2) { // bottom left point
pair = make_pair(centerPt.first + 3.875, centerPt.second - 39);
corners.push_back(pair);
} else if (i == 3) { // bottom right point
pair = make_pair(24 - (3.875 - centerPt.first), centerPt.second - 39);
corners.push_back(pair);
}
}
} else if (centerPt.first > 20.125 && centerPt.second < -51) { // done
for(int i = 0; i < 4; i++) {
pair<double, double> pair;
if (i == 0) { // top left point
pair = make_pair((centerPt.first + 3.875) - 24, centerPt.second + 39);
corners.push_back(pair);
} else if (i == 1) { // top right point
pair = make_pair(centerPt.first - 3.875, centerPt.second + 39);
corners.push_back(pair);
} else if (i == 2) { // bottom left point
pair = make_pair((centerPt.first + 3.875) - 24, 90 + (centerPt.second + 51));
corners.push_back(pair);
} else if (i == 3) { // bottom right point
pair = make_pair(centerPt.first - 3.875, 90 + (centerPt.second + 51));
corners.push_back(pair);
}
}
} else if (centerPt.first < 3.875 && centerPt.second < -51) {
for(int i = 0; i < 4; i++) {
pair<double, double> pair;
if (i == 0) { // top left point
pair = make_pair(centerPt.first + 3.875, centerPt.second + 39);
corners.push_back(pair);
} else if (i == 1) { // top right point
pair = make_pair(24 - (3.875 - centerPt.first), centerPt.second + 39);
corners.push_back(pair);
} else if (i == 2) { // bottom left point
pair = make_pair(centerPt.first + 3.875, 90 + (centerPt.second + 51));
corners.push_back(pair);
} else if (i == 3) { // bottom right point
pair = make_pair(24 - (3.875 - centerPt.first), 90 + (centerPt.second + 51));
corners.push_back(pair);
}
}
} else if ((centerPt.first < 20.125 && centerPt.first > 3.875) && centerPt.second < -51) {
for(int i = 0; i < 4; i++) {
pair<double, double> pair;
if (i == 0) { // top left point
pair = make_pair(centerPt.first + 3.875, centerPt.second + 39);
corners.push_back(pair);
} else if (i == 1) { // top right point
pair = make_pair(centerPt.first - 3.875, centerPt.second + 39);
corners.push_back(pair);
} else if (i == 2) { // bottom left point
pair = make_pair(centerPt.first + 3.875, 90 + (centerPt.second + 51));
corners.push_back(pair);
} else if (i == 3) { // bottom right point
pair = make_pair(centerPt.first - 3.875, 90 + (centerPt.second + 51));
corners.push_back(pair);
}
}
} else if ((centerPt.first < 20.125 && centerPt.first > 3.875) && centerPt.second > -51) {
for(int i = 0; i < 4; i++) {
pair<double, double> pair;
if (i == 0) { // top left point
pair = make_pair(centerPt.first + 3.875, centerPt.second + 39);
corners.push_back(pair);
} else if (i == 1) { // top right point
pair = make_pair(centerPt.first - 3.875, centerPt.second + 39);
corners.push_back(pair);
} else if (i == 2) { // bottom left point
pair = make_pair(centerPt.first + 3.875, centerPt.second - 39);
corners.push_back(pair);
} else if (i == 3) { // bottom right point
pair = make_pair(centerPt.first - 3.875, centerPt.second - 39);
corners.push_back(pair);
}
}
}
}
return corners;
}
\ No newline at end of file
......@@ -440,7 +440,7 @@ void Stars::Capricornus() {
}
}
void Stars::Pegasus() { //done
void Stars::Pegasus() { //done: coordinates based on pic 11:02pm at 24 degrees
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;
......
Supports Markdown
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