Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rugged
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Orekit
Rugged
Commits
fc95ed7b
Commit
fc95ed7b
authored
6 years ago
by
Guylaine Prat
Browse files
Options
Downloads
Patches
Plain Diff
Checkstyle corrections
parent
ade02e21
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java
+51
-52
51 additions, 52 deletions
...kit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java
with
51 additions
and
52 deletions
src/main/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java
+
51
−
52
View file @
fc95ed7b
...
@@ -175,58 +175,57 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm {
...
@@ -175,58 +175,57 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm {
NormalizedGeodeticPoint
currentGuess
=
closeGuess
;
NormalizedGeodeticPoint
currentGuess
=
closeGuess
;
NormalizedGeodeticPoint
foundIntersection
=
null
;
NormalizedGeodeticPoint
foundIntersection
=
null
;
if
(
flatBody
)
{
if
(
flatBody
)
{
// under the (bad) flat-body assumption, the reference point must remain
// under the (bad) flat-body assumption, the reference point must remain
// at DEM entry and exit, even if we already have a much better close guess :-(
// at DEM entry and exit, even if we already have a much better close guess :-(
// this is in order to remain consistent with other systems
// this is in order to remain consistent with other systems
final
Tile
tile
=
cache
.
getTile
(
currentGuess
.
getLatitude
(),
currentGuess
.
getLongitude
());
final
Tile
tile
=
cache
.
getTile
(
currentGuess
.
getLatitude
(),
currentGuess
.
getLongitude
());
final
Vector3D
exitP
=
ellipsoid
.
pointAtAltitude
(
position
,
los
,
tile
.
getMinElevation
());
final
Vector3D
exitP
=
ellipsoid
.
pointAtAltitude
(
position
,
los
,
tile
.
getMinElevation
());
final
Vector3D
entryP
=
ellipsoid
.
pointAtAltitude
(
position
,
los
,
tile
.
getMaxElevation
());
final
Vector3D
entryP
=
ellipsoid
.
pointAtAltitude
(
position
,
los
,
tile
.
getMaxElevation
());
final
NormalizedGeodeticPoint
entry
=
ellipsoid
.
transform
(
entryP
,
ellipsoid
.
getBodyFrame
(),
null
,
final
NormalizedGeodeticPoint
entry
=
ellipsoid
.
transform
(
entryP
,
ellipsoid
.
getBodyFrame
(),
null
,
tile
.
getMinimumLongitude
());
tile
.
getMinimumLongitude
());
foundIntersection
=
tile
.
cellIntersection
(
entry
,
ellipsoid
.
convertLos
(
entryP
,
exitP
),
foundIntersection
=
tile
.
cellIntersection
(
entry
,
ellipsoid
.
convertLos
(
entryP
,
exitP
),
tile
.
getFloorLatitudeIndex
(
currentGuess
.
getLatitude
()),
tile
.
getFloorLatitudeIndex
(
currentGuess
.
getLatitude
()),
tile
.
getFloorLongitudeIndex
(
currentGuess
.
getLongitude
()));
tile
.
getFloorLongitudeIndex
(
currentGuess
.
getLongitude
()));
}
else
{
// with a DEM
}
else
{
// with a DEM
while
(
foundIntersection
==
null
&&
(
nbCall
<
NB_TIME_CELL_INTERSECTION
))
{
while
(
foundIntersection
==
null
&&
(
nbCall
<
NB_TIME_CELL_INTERSECTION
))
{
final
Vector3D
delta
=
ellipsoid
.
transform
(
currentGuess
).
subtract
(
position
);
final
Vector3D
delta
=
ellipsoid
.
transform
(
currentGuess
).
subtract
(
position
);
final
double
s
=
Vector3D
.
dotProduct
(
delta
,
los
)
/
los
.
getNormSq
();
final
double
s
=
Vector3D
.
dotProduct
(
delta
,
los
)
/
los
.
getNormSq
();
final
GeodeticPoint
projected
=
ellipsoid
.
transform
(
new
Vector3D
(
1
,
position
,
s
,
los
),
final
GeodeticPoint
projected
=
ellipsoid
.
transform
(
new
Vector3D
(
1
,
position
,
s
,
los
),
ellipsoid
.
getBodyFrame
(),
null
);
ellipsoid
.
getBodyFrame
(),
null
);
final
NormalizedGeodeticPoint
normalizedProjected
=
final
NormalizedGeodeticPoint
normalizedProjected
=
new
NormalizedGeodeticPoint
(
projected
.
getLatitude
(),
new
NormalizedGeodeticPoint
(
projected
.
getLatitude
(),
projected
.
getLongitude
(),
projected
.
getLongitude
(),
projected
.
getAltitude
(),
projected
.
getAltitude
(),
currentGuess
.
getLongitude
());
currentGuess
.
getLongitude
());
final
Tile
tile
=
cache
.
getTile
(
normalizedProjected
.
getLatitude
(),
normalizedProjected
.
getLongitude
());
final
Tile
tile
=
cache
.
getTile
(
normalizedProjected
.
getLatitude
(),
normalizedProjected
.
getLongitude
());
foundIntersection
=
tile
.
cellIntersection
(
normalizedProjected
,
foundIntersection
=
tile
.
cellIntersection
(
normalizedProjected
,
ellipsoid
.
convertLos
(
normalizedProjected
,
los
),
ellipsoid
.
convertLos
(
normalizedProjected
,
los
),
tile
.
getFloorLatitudeIndex
(
normalizedProjected
.
getLatitude
()),
tile
.
getFloorLatitudeIndex
(
normalizedProjected
.
getLatitude
()),
tile
.
getFloorLongitudeIndex
(
normalizedProjected
.
getLongitude
()));
tile
.
getFloorLongitudeIndex
(
normalizedProjected
.
getLongitude
()));
// For extremely rare case : the cell intersection gave no results ...
// For extremely rare case : the cell intersection gave no results ...
// We use as a new guess a slightly modified projected geodetic point (which is on the LOS line)
// We use as a new guess a slightly modified projected geodetic point (which is on the LOS line)
if
(
foundIntersection
==
null
)
{
if
(
foundIntersection
==
null
)
{
final
double
shiftedS
=
s
-
1
;
double
shiftedS
=
s
-
1
;
final
GeodeticPoint
currentGuessGP
=
ellipsoid
.
transform
(
new
Vector3D
(
1
,
position
,
shiftedS
,
los
),
GeodeticPoint
currentGuessGP
=
ellipsoid
.
transform
(
new
Vector3D
(
1
,
position
,
shiftedS
,
los
),
ellipsoid
.
getBodyFrame
(),
null
);
ellipsoid
.
getBodyFrame
(),
null
);
currentGuess
=
new
NormalizedGeodeticPoint
(
currentGuessGP
.
getLatitude
(),
currentGuess
=
new
NormalizedGeodeticPoint
(
currentGuessGP
.
getLatitude
(),
currentGuessGP
.
getLongitude
(),
currentGuessGP
.
getLongitude
(),
currentGuessGP
.
getAltitude
(),
currentGuessGP
.
getAltitude
(),
projected
.
getLongitude
());
projected
.
getLongitude
());
// to avoid infinite loop ...
// to avoid infinite loop ...
nbCall
++;
nbCall
++;
}
}
}
// end while foundIntersection = null
}
// end while foundIntersection = null
}
// end test on flatbody
}
// end test on flatbody
return
foundIntersection
;
return
foundIntersection
;
}
}
/** {@inheritDoc} */
/** {@inheritDoc} */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment