Commit fb2fbf14 authored by Brandon Reid's avatar Brandon Reid

autosave

parent b459ba18
......@@ -440,7 +440,6 @@ vector <pair<double, double>> viewFinder (pair <double, double> centerPt) { // f
vector <pair<double, double>> constellationCoordinates () { // Function to store the coordinates of the constellations
vector <pair<double, double>> coordinates;
cout << "Made it here 1" << endl;
// Canis Major
coordinates.push_back(make_pair(7.45, -9.0));
coordinates.push_back(make_pair(6.1, -9.0));
......@@ -543,41 +542,42 @@ vector <pair<double, double>> constellationCoordinates () { // Function to store
coordinates.push_back(make_pair(8.6, 61.0));
coordinates.push_back(make_pair(13.7, 32.0));
coordinates.push_back(make_pair(8.6, 32.0));
cout << "Made it here 2" << endl;
return coordinates;
}
void printConstellation (vector <pair<double,double>> constellationCoordinates, vector <pair<double,double>> window) {
//double windowLeft = window.at()
// variables
double windowLeft = window.at(0).first;
double windowRight = window.at(1).first;
double windowTop = window.at(0).second;
double windowBottom = window.at(3).second;
int inrangeCount = 0;
int coordinateCount = 0;
cout << "Made it here 3" << endl;
for(unsigned int j = 0; j < ((constellationCoordinates.size() + 1) / 4); j++) {
for(unsigned int j = 0; j < (constellationCoordinates.size() / 4) - 1; j++) {
inrangeCount = 0;
for (int i = 0; i < 4; i++) {
coordinateCount++;
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))) {
if((windowLeft > constellationCoordinates.at(coordinateCount).first) && (constellationCoordinates.at(coordinateCount).first < windowRight)
&& (windowTop > constellationCoordinates.at(coordinateCount).second) && (constellationCoordinates.at(coordinateCount).second > windowBottom)) {
inrangeCount++;
}
}
if (inrangeCount == 4) {
cout << "Constellation" << constellationNamer(coordinateCount) << "is fully in view." << endl
<< "Here is an image." << endl;
constellationOutputter(coordinateCount);
cout << "Constellation" << constellationNamer(coordinateCount - 1) << "is fully in view." << endl
<< "Here is an image." << endl << "============================================" << endl;
constellationOutputter(coordinateCount - 1);
} else if (inrangeCount < 4 && inrangeCount > 0) {
cout << "Constellation" << constellationNamer(coordinateCount) << "is partially in view." << endl
<< "Here is an image." << endl;
constellationOutputter(coordinateCount);
cout << "Constellation" << constellationNamer(coordinateCount - 1) << "is partially in view." << endl
<< "Here is an image." << endl << "============================================" << endl;
constellationOutputter(coordinateCount - 1);
} else {
cout << endl;
}
}
}
......
#include <iostream>
#include "Functions.h"
#include "Stars.h"
#include <vector>
#include <string>
#include <utility>
......@@ -34,6 +35,7 @@ int main () {
cout << "==============Welcome to the Star-Gazer v 1.0==============" << endl;
do {
//Stars a;
// yearInput = yearPrompt();
// monthInput = monthPrompt();
......@@ -45,11 +47,10 @@ int main () {
// minuteInput = minutePrompt();
// testPair = altAndAziPair ();
// cout << "Made it here 4" << endl;
// printConstellation (coordinates, window);
// for (int i = 0; i < coordinates.size(); i++) {
// cout << coordinates.at(i).first << endl;
printConstellation (coordinates, window);
// for (unsigned int i = 0; i < coordinates.size(); i++) {
// cout << coordinates.at(i).first << " , ";
// cout << coordinates.at(i).second << endl;
// }
} while (false);
......
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