Commit b09c1123 authored by Eric Walsh's avatar Eric Walsh

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

parents e1c5407c 618385db
#include "Functions.h"
#include "Stars.h"
#include "Constellation.h"
#include <string>
#include <iostream>
#include <vector>
......@@ -174,7 +176,6 @@ pair<double,double> altAndAziPair () {
return aziPair;
}
double dateToHour (string month, int year, int day, int hour, int minute) { // Converts the date into hours
//variables
double totHours = 0;
......@@ -244,20 +245,20 @@ vector <pair<double, double>> viewFinder (pair <double, double> centerPt) { // f
pair1 = make_pair((centerPt.first + 3.875) - 24, centerPt.second + 39);
corners.push_back(pair1);
} else if (i == 1) { // top right point
pair2 = make_pair(centerPt.first - 3.875), centerPt.second + 39);
pair2 = make_pair((centerPt.first - 3.875), centerPt.second + 39);
corners.push_back(pair2);
} else if (i == 2) { // bottom left point
pair3 = make_pair((centerPt.first + 3.875) - 24, centerPt.second - 39);
corners.push_back(pair3);
} else if (i == 3) { // bottom right point
pair4 = make_pair(centerPt.first - 3.875), centerPt.second - 39);
pair4 = make_pair((centerPt.first - 3.875), centerPt.second - 39);
corners.push_back(pair4);
}
}
} else if (centerPt.first < 3.875 && centerPt.second < 51) { // done
for(int i = 0; i < 4; i++) {
if (i == 0) { // top left point
pair1 = make_pair(centerPt.first + 3.875), centerPt.second + 39);
pair1 = make_pair((centerPt.first + 3.875), centerPt.second + 39);
corners.push_back(pair1);
} else if (i == 1) { // top right point
pair2 = make_pair(24 - (3.875 - centerPt.first), centerPt.second + 39);
......@@ -342,20 +343,20 @@ vector <pair<double, double>> viewFinder (pair <double, double> centerPt) { // f
pair1 = make_pair((centerPt.first + 3.875) - 24, centerPt.second + 39);
corners.push_back(pair1);
} else if (i == 1) { // top right point
pair2 = make_pair(centerPt.first - 3.875), centerPt.second + 39);
pair2 = make_pair((centerPt.first - 3.875), centerPt.second + 39);
corners.push_back(pair2);
} else if (i == 2) { // bottom left point
pair3 = make_pair((centerPt.first + 3.875) - 24, centerPt.second - 39);
corners.push_back(pair3);
} else if (i == 3) { // bottom right point
pair4 = make_pair(centerPt.first - 3.875), centerPt.second - 39);
pair4 = make_pair((centerPt.first - 3.875), centerPt.second - 39);
corners.push_back(pair4);
}
}
} else if (centerPt.first < 3.875 && centerPt.second > -51) { // done
for(int i = 0; i < 4; i++) {
if (i == 0) { // top left point
pair1 = make_pair(centerPt.first + 3.875), centerPt.second + 39);
pair1 = make_pair((centerPt.first + 3.875), centerPt.second + 39);
corners.push_back(pair1);
} else if (i == 1) { // top right point
pair2 = make_pair(24 - (3.875 - centerPt.first), centerPt.second + 39);
......@@ -604,7 +605,7 @@ vector <pair<double, double>> constellationCoordinates () {
pair<double, double> pair12c;
pair12c = make_pair(18.0, -42.0);
coordinates.push_back(pair12c);
pair<double, double> pair1d;
pair<double, double> pair12d;
pair12d = make_pair(16.0, -42.0);
coordinates.push_back(pair12d);
......@@ -615,7 +616,7 @@ vector <pair<double, double>> constellationCoordinates () {
pair<double, double> pair13b;
pair13b = make_pair(20.3, -12.0);
coordinates.push_back(pair13b);
pair<double, double> pair1c;
pair<double, double> pair13c;
pair13c = make_pair(21.8, -28.0);
coordinates.push_back(pair13c);
pair<double, double> pair13d;
......@@ -629,7 +630,7 @@ vector <pair<double, double>> constellationCoordinates () {
pair<double, double> pair14b;
pair14b = make_pair(21.2, 30.0);
coordinates.push_back(pair14b);
pair<double, double> pair1c;
pair<double, double> pair14c;
pair14c = make_pair(.2, 6.0);
coordinates.push_back(pair14c);
pair<double, double> pair14d;
......@@ -671,27 +672,27 @@ vector <pair<double, double>> constellationCoordinates () {
pair<double, double> pair17b;
pair17b = make_pair(8.6, 61.0);
coordinates.push_back(pair17b);
pair<double, double> pair1c;
pair<double, double> pair17c;
pair17c = make_pair(13.7, 32.0);
coordinates.push_back(pair17c);
pair<double, double> pair1d;
pair<double, double> pair17d;
pair17d = make_pair(8.6, 32.0);
coordinates.push_back(pair17d);
}
void viewWindow (vector <pair<double,double>> constellationCoordinates, vector <pair<double,double>> window) {
void printConstellation (vector <pair<double,double>> constellationCoordinates, vector <pair<double,double>> window) {
int inrangeCount = 0;
int coordinateCount = 0;
for(int j = 0; j < (constellationCoordinates.size / 4); j++) {
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))) {
if(((window.at(0).first) > (constellationCoordinates.at(coordinateCount).first)) && ((window.at(1).first) < (constellationCoordinates.at(coordinateCount).first))
&& ((window.at(2).first) > (constellationCoordinates.at(coordinateCount).first)) && ((window.at(3).first) < (constellationCoordinates.at(coordinateCount).first))
&& ((window.at(0).second) > (constellationCoordinates.at(coordinateCount).second)) && ((window.at(1).second) < (constellationCoordinates.at(coordinateCount).second))
&& ((window.at(2).second) > (constellationCoordinates.at(coordinateCount).second)) && ((window.at(3).second) < (constellationCoordinates.at(coordinateCount).second))) {
inrangeCount++;
}
}
......@@ -699,7 +700,7 @@ void viewWindow (vector <pair<double,double>> constellationCoordinates, vector <
cout << "Constellation" << constellationNamer(coordinateCount) << "is fully in view." << endl
<< "Here is an image." << endl;
constellationOutputter(coordinateCount);
} else if (inrangeCount > 4 && inrangeCount > 0) {
} else if (inrangeCount < 4 && inrangeCount > 0) {
cout << "Constellation" << constellationNamer(coordinateCount) << "is partially in view." << endl
<< "Here is an image." << endl;
constellationOutputter(coordinateCount);
......@@ -773,13 +774,13 @@ void constellationOutputter (int index) {
} else if (index == 43) {
a.Sagistarius10();
} else if (index == 47) {
a.Scorpius11()
a.Scorpius11();
} else if (index == 51) {
a.Capricornus12();
} else if (index == 55) {
a.Pegasus13();
} else if (index == 59) {
a.Pisces14()
a.Pisces14();
} else if (index == 63) {
a.UrsaMinor15();
} else if (index == 67) {
......
#include <string>
#include <vector>
using namespace std;
......@@ -16,4 +17,14 @@ double dateToHour (string month, int day, int hour, int minute); // Converts ful
pair<double,double> altAndAziPair (); // Creates pair of alitutude and azimuth
bool isLeap (int year); // Bool check for leap year
\ No newline at end of file
bool isLeap (int year); // Bool check for leap year
vector <pair<double, double>> viewFinder (pair <double, double> centerPt);
vector <pair<double, double>> constellationCoordinates ();
void printConstellation (vector <pair<double,double>> constellationCoordinates, vector <pair<double,double>> window);
string constellationNamer (int index);
void constellationOutputter (int index);
\ No newline at end of file
......@@ -15,23 +15,23 @@ class Stars {
public:
void CanisMajor();
void Eridanius();
void Gemini();
void Orion();
void Tarus();
void Bootes();
void Cancer();
void Leo();
void Virgo();
void Aquila();
void Sagistarius();
void Scorpius();
void Capricornus();
void Pegasus();
void Pisces();
void UrsaMinor();
void UrsaMajor();
void CanisMajor0();
void Eridanius1();
void Gemini2();
void Orion3();
void Tarus4();
void Bootes5();
void Cancer6();
void Leo7();
void Virgo8();
void Aquila9();
void Sagistarius10();
void Scorpius11();
void Capricornus12();
void Pegasus13();
void Pisces14();
void UrsaMinor15();
void UrsaMajor16();
private:
......
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