Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
Project 3 Star Gazing
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eric Walsh
Project 3 Star Gazing
Commits
b09c1123
Commit
b09c1123
authored
Mar 18, 2019
by
Eric Walsh
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.cs.wallawalla.edu:walser/project-3-star-gazing
parents
e1c5407c
618385db
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
22 deletions
+76
-22
Input stuff/Constellation.h
Input stuff/Constellation.h
+0
-0
Input stuff/Functions.cpp
Input stuff/Functions.cpp
+22
-21
Input stuff/Functions.h
Input stuff/Functions.h
+12
-1
Input stuff/Stars.cpp
Input stuff/Stars.cpp
+0
-0
Input stuff/Stars.h
Input stuff/Stars.h
+42
-0
No files found.
Star Array
/Constellation.h
→
Input stuff
/Constellation.h
View file @
b09c1123
File moved
Input stuff/Functions.cpp
View file @
b09c1123
#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
>
pair1
2
d
;
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
>
pair1
3
c
;
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
>
pair1
4
c
;
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
>
pair1
7
c
;
pair17c
=
make_pair
(
13.7
,
32.0
);
coordinates
.
push_back
(
pair17c
);
pair
<
double
,
double
>
pair1d
;
pair
<
double
,
double
>
pair1
7
d
;
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
(((
window
n
.
at
(
0
).
first
)
>
(
constellationCoordinates
.
at
(
coordinateCount
).
first
))
&&
((
windown
.
at
(
1
).
first
)
<
(
constellationCoordinates
.
at
(
coordinateCount
).
first
))
&&
((
window
n
.
at
(
2
).
first
)
>
(
constellationCoordinates
.
at
(
coordinateCount
).
first
))
&&
((
windown
.
at
(
3
).
first
)
<
(
constellationCoordinates
.
at
(
coordinateCount
).
first
))
&&
((
window
n
.
at
(
0
).
second
)
>
(
constellationCoordinates
.
at
(
coordinateCount
).
second
))
&&
((
windown
.
at
(
1
).
second
)
<
(
constellationCoordinates
.
at
(
coordinateCount
).
second
))
&&
((
window
n
.
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
)
{
...
...
Input stuff/Functions.h
View file @
b09c1123
#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
Star Array
/Stars.cpp
→
Input stuff
/Stars.cpp
View file @
b09c1123
File moved
Star Array
/Stars.h
→
Input stuff
/Stars.h
View file @
b09c1123
...
...
@@ -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
CanisMajor
0
();
void
Eridanius
1
();
void
Gemini
2
();
void
Orion
3
();
void
Tarus
4
();
void
Bootes
5
();
void
Cancer
6
();
void
Leo
7
();
void
Virgo
8
();
void
Aquila
9
();
void
Sagistarius
10
();
void
Scorpius
11
();
void
Capricornus
12
();
void
Pegasus
13
();
void
Pisces
14
();
void
UrsaMinor
15
();
void
UrsaMajor
16
();
private:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment