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
36befffc
Commit
36befffc
authored
Mar 18, 2019
by
Brandon Reid
Browse files
Options
Browse Files
Download
Plain Diff
autosave
parents
c2253278
4e1ad862
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
16 deletions
+42
-16
Input stuff/Functions.cpp
Input stuff/Functions.cpp
+35
-15
Star Array/Stars.cpp
Star Array/Stars.cpp
+4
-0
Star Array/main.cpp
Star Array/main.cpp
+3
-1
No files found.
Input stuff/Functions.cpp
View file @
36befffc
...
...
@@ -175,14 +175,12 @@ pair<double,double> altAndAziPair () {
}
double
dateToHour
(
string
month
,
int
day
,
int
hour
,
int
minute
)
{
// Converts the date into hours
double
dateToHour
(
string
month
,
int
year
,
int
day
,
int
hour
,
int
minute
)
{
// Converts the date into hours
//variables
double
totHours
=
0
;
int
monthNum
=
0
;
if
(
month
==
"January"
)
{
if
(
month
==
"January"
)
{
// For the number of months before each month in order
monthNum
=
0
;
}
else
if
(
month
==
"February"
)
{
monthNum
=
1
;
...
...
@@ -207,21 +205,19 @@ double dateToHour (string month, int day, int hour, int minute) { // Converts th
}
else
{
monthNum
=
11
;
}
if
(
month
==
"January"
||
month
==
"March"
||
month
==
"May"
||
month
==
"July"
||
month
==
"August"
||
month
==
"October"
||
month
==
"December"
)
{
if
(
month
==
"January"
||
month
==
"March"
||
month
==
"May"
||
month
==
"July"
||
month
==
"August"
||
month
==
"October"
||
month
==
"December"
)
{
//Calculates the amount of hours for the months with 31 days
totHours
=
(
monthNum
*
744
)
+
((
day
-
1
)
*
24
)
+
(
hour
-
1
)
+
(
minute
/
60
);
}
else
if
(
month
==
"April"
||
month
==
"June"
||
month
==
"September"
||
month
==
"November"
)
{
else
if
(
month
==
"April"
||
month
==
"June"
||
month
==
"September"
||
month
==
"November"
)
{
// Calculates the hours for the months with 30 days
totHours
=
(
monthNum
*
720
)
+
((
day
-
1
)
*
24
)
+
(
hour
-
1
)
+
(
minute
/
60
);
}
else
if
(
month
==
"February"
)
{
if
(
isLeap
(
year
))
{
totHours
=
(
monthNum
*
696
)
+
((
day
-
1
)
*
24
)
+
(
hour
-
1
)
+
(
minute
/
60
);
}
}
else
if
(
!
isLeap
(
year
))
{
totHours
=
(
monthNum
*
672
)
+
((
day
-
1
)
*
24
)
+
(
hour
-
1
)
+
(
minute
/
60
);
}
}
else
if
(
month
==
"February"
)
{
if
(
isLeap
(
year
))
{
// Takes leap year into consideration and calculates the days in February with 29 days
totHours
=
(
monthNum
*
696
)
+
((
day
-
1
)
*
24
)
+
(
hour
-
1
)
+
(
minute
/
60
);
}
else
if
(
!
isLeap
(
year
))
{
// Calculates when February has 28 days
totHours
=
(
monthNum
*
672
)
+
((
day
-
1
)
*
24
)
+
(
hour
-
1
)
+
(
minute
/
60
);
}
}
return
totHours
;
}
...
...
@@ -442,6 +438,7 @@ vector <pair<double, double>> viewFinder (pair <double, double> centerPt) { // f
return
corners
;
}
<<<<<<<
HEAD
vector
<
pair
<
double
,
double
>>
constellationCoordinates
()
{
vector
<
pair
<
double
,
double
>>
coordinates
;
// Canis Major
...
...
@@ -555,4 +552,27 @@ vector <pair<double, double>> constellationCoordinates () {
pair
<
double
,
double
>
pair8d
;
pair8d
=
make_pair
(
6.1
,
-
33.0
);
coordinates
.
push_back
(
pair8d
);
}
\ No newline at end of file
}
=======
void
viewWindow
(
vector
<
pair
<
double
,
double
>>
corners
,
pair
<
double
,
double
>
constellationCoord
)
{
pair
<
double
,
double
>
coordinates1
;
pair
<
double
,
double
>
coordinates2
;
pair
<
double
,
double
>
coordinates3
;
pair
<
double
,
double
>
coordinates4
;
if
(
corners
.
coordinates1
.
first
>
constellationCoord
.
first
&&
corners
.
coordinates1
.
second
>
constellationCoord
.
second
&&
corners
.
coordinates2
.
first
<
constellationCoord
.
first
&&
corners
.
coordinates2
.
second
>
constellationCoord
.
second
&&
corners
.
coordinates3
.
first
>
constellationCoord
.
first
&&
corners
.
coordinates3
.
second
<
constellationCoord
.
second
&&
corners
.
coordinates4
.
first
<
constellationCoord
.
first
&&
corners
.
coordinates4
.
second
<
constellationCoord
.
second
)
{
cout
<<
"Constellation is fully in view"
<<
endl
;
}
else
if
(
corners
.
coordinates1
.
first
>
constellationCoord
.
first
||
corners
.
coordinates1
.
second
>
constellationCoord
.
second
||
corners
.
coordinates2
.
first
<
constellationCoord
.
first
||
corners
.
coordinates2
.
second
>
constellationCoord
.
second
||
corners
.
coordinates3
.
first
>
constellationCoord
.
first
||
corners
.
coordinates3
.
second
<
constellationCoord
.
second
||
corners
.
coordinates4
.
first
<
constellationCoord
.
first
||
corners
.
coordinates4
.
second
<
constellationCoord
.
second
)
{
cout
<<
"Constellation is partially in view"
<<
endl
;
}
else
{
cout
<<
"Constellation is not in view"
<<
endl
;
}
}
>>>>>>>
4e1
ad8624316617b8f087e4405e4375a485173e0
Star Array/Stars.cpp
View file @
36befffc
...
...
@@ -442,7 +442,11 @@ void Stars::Capricornus12() {
}
}
<<<<<<<
HEAD
void
Stars
::
Pegasus13
()
{
//done
=======
void
Stars
::
Pegasus
()
{
//done: coordinates based on pic 11:02pm at 24 degrees
>>>>>>>
4e1
ad8624316617b8f087e4405e4375a485173e0
for
(
int
row
=
0
;
row
<
24
;
row
++
)
{
for
(
int
col
=
0
;
col
<
40
;
col
++
)
{
...
...
Star Array/main.cpp
View file @
36befffc
...
...
@@ -10,7 +10,9 @@ using namespace std;
int
main
()
{
Stars
s
;
s
.
UrsaMinor
();
s
.
Pegasus
();
return
0
;
...
...
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