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
6a7502fd
Commit
6a7502fd
authored
Mar 18, 2019
by
Brandon Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autosave
parent
2a9fee8e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
19 deletions
+31
-19
Input stuff/Functions.cpp
Input stuff/Functions.cpp
+19
-18
Input stuff/Functions.h
Input stuff/Functions.h
+12
-1
No files found.
Input stuff/Functions.cpp
View file @
6a7502fd
#include "Functions.h"
#include "Stars.h"
#include "Constellation.h"
#include <string>
#include <iostream>
#include <vector>
...
...
@@ -245,20 +246,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
);
...
...
@@ -343,20 +344,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
);
...
...
@@ -605,7 +606,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
);
...
...
@@ -616,7 +617,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
;
...
...
@@ -630,7 +631,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
;
...
...
@@ -672,10 +673,10 @@ 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
);
}
...
...
@@ -685,14 +686,14 @@ void printConstellation (vector <pair<double,double>> constellationCoordinates,
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
++
;
}
}
...
...
@@ -774,13 +775,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 @
6a7502fd
#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
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