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
f4881005
Commit
f4881005
authored
Mar 18, 2019
by
Brandon Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autosave
parent
37773ebd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
105 additions
and
23 deletions
+105
-23
Input stuff/Functions.cpp
Input stuff/Functions.cpp
+103
-17
Star Array/Stars.cpp
Star Array/Stars.cpp
+2
-6
No files found.
Input stuff/Functions.cpp
View file @
f4881005
...
...
@@ -680,23 +680,109 @@ vector <pair<double, double>> constellationCoordinates () {
}
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
;
void
viewWindow
(
vector
<
pair
<
double
,
double
>>
constellationCoordinates
,
vector
<
pair
<
double
,
double
>>
window
)
{
int
inrangeCount
=
0
;
int
coordinateCount
=
0
;
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
;
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
)))
{
inrangeCount
++
;
}
}
if
(
inrangeCount
==
4
)
{
cout
<<
"Constellation"
<<
constellationNamer
(
coordinateCount
)
<<
"is fully in view."
<<
endl
<<
"Here is an image."
<<
endl
;
constellationOutputter
(
coordinateCount
);
}
else
if
(
inrangeCount
>
4
&&
inrangeCount
>
0
)
{
cout
<<
"Constellation"
<<
constellationNamer
(
coordinateCount
)
<<
"is partially in view."
<<
endl
<<
"Here is an image."
<<
endl
;
constellationOutputter
(
coordinateCount
);
}
else
{
cout
<<
endl
;
}
}
}
string
constellationNamer
(
int
index
)
{
if
(
index
==
3
)
{
return
" Canis Major "
;
}
else
if
(
index
==
7
)
{
return
" Eridanius "
;
}
else
if
(
index
==
11
)
{
return
" Gemini "
;
}
else
if
(
index
==
15
)
{
return
" Orion "
;
}
else
if
(
index
==
19
)
{
return
" Tarus "
;
}
else
if
(
index
==
23
)
{
return
" Bootes "
;
}
else
if
(
index
==
27
)
{
return
" Cancer"
;
}
else
if
(
index
==
31
)
{
return
" Leo "
;
}
else
if
(
index
==
35
)
{
return
" Virgo "
;
}
else
if
(
index
==
39
)
{
return
" Aquila "
;
}
else
if
(
index
==
43
)
{
return
" Sagitarius "
;
}
else
if
(
index
==
47
)
{
return
" Scorpius "
;
}
else
if
(
index
==
51
)
{
return
" Capricornus "
;
}
else
if
(
index
==
55
)
{
return
" Pegasus "
;
}
else
if
(
index
==
59
)
{
return
" Pisces "
;
}
else
if
(
index
==
63
)
{
return
" Ursa Minor "
;
}
else
if
(
index
==
67
)
{
return
" Ursa Major "
;
}
}
void
constellationOutputter
(
int
index
)
{
Stars
a
;
if
(
index
==
3
)
{
a
.
CanisMajor0
();
}
else
if
(
index
==
7
)
{
a
.
Eridanius1
();
}
else
if
(
index
==
11
)
{
a
.
Gemini2
();
}
else
if
(
index
==
15
)
{
a
.
Orion3
();
}
else
if
(
index
==
19
)
{
a
.
Tarus4
();
}
else
if
(
index
==
23
)
{
a
.
Bootes5
();
}
else
if
(
index
==
27
)
{
a
.
Cancer6
();
}
else
if
(
index
==
31
)
{
a
.
Leo7
();
}
else
if
(
index
==
35
)
{
a
.
Virgo8
();
}
else
if
(
index
==
39
)
{
a
.
Aquila9
();
}
else
if
(
index
==
43
)
{
a
.
Sagistarius10
();
}
else
if
(
index
==
47
)
{
a
.
Scorpius11
()
}
else
if
(
index
==
51
)
{
a
.
Capricornus12
();
}
else
if
(
index
==
55
)
{
a
.
Pegasus13
();
}
else
if
(
index
==
59
)
{
a
.
Pisces14
()
}
else
if
(
index
==
63
)
{
a
.
UrsaMinor15
();
}
else
if
(
index
==
67
)
{
a
.
UrsaMajor16
();
}
}
Star Array/Stars.cpp
View file @
f4881005
...
...
@@ -442,12 +442,8 @@ void Stars::Capricornus12() {
}
}
<<<<<<<
HEAD
void
Stars
::
Pegasus13
()
{
//done
=======
void
Stars
::
Pegasus
()
{
//done: coordinates based on pic 11:02pm at 24 degrees
>>>>>>>
4e1
ad8624316617b8f087e4405e4375a485173e0
void
Stars
::
Pegasus13
()
{
//done: coordinates based on pic 11:02pm at 24 degrees
for
(
int
row
=
0
;
row
<
24
;
row
++
)
{
for
(
int
col
=
0
;
col
<
40
;
col
++
)
{
...
...
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