Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rugged-MOD
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
youngcle
Rugged-MOD
Commits
abdae142
Commit
abdae142
authored
10 years ago
by
Luc Maisonobe
Browse files
Options
Downloads
Patches
Plain Diff
Fixed mean reference point position.
parent
aad8de72
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/core/Sensor.java
+22
-9
22 additions, 9 deletions
src/main/java/org/orekit/rugged/core/Sensor.java
with
22 additions
and
9 deletions
src/main/java/org/orekit/rugged/core/Sensor.java
+
22
−
9
View file @
abdae142
...
...
@@ -48,7 +48,7 @@ public class Sensor {
/** Mean plane normal. */
private
final
Vector3D
normal
;
/** Mean
plane
reference point. */
/** Mean reference point. */
private
final
Vector3D
referencePoint
;
/** Simple constructor.
...
...
@@ -65,34 +65,47 @@ public class Sensor {
this
.
los
=
los
;
this
.
datationModel
=
datationModel
;
// mean reference point
double
sumX
=
0
;
double
sumY
=
0
;
double
sumZ
=
0
;
for
(
int
i
=
0
;
i
<
los
.
size
();
++
i
)
{
final
Vector3D
p
=
positions
.
get
(
i
);
sumX
+=
p
.
getX
();
sumY
+=
p
.
getY
();
sumZ
+=
p
.
getZ
();
}
sumX
/=
los
.
size
();
sumY
/=
los
.
size
();
sumZ
/=
los
.
size
();
referencePoint
=
new
Vector3D
(
sumX
,
sumY
,
sumZ
);
// we consider the viewing directions as a point cloud
// and want to find the plane that best fits it
// start by finding the centroid
// (which will also be our plane reference point)
double
centroidX
=
0
;
double
centroidY
=
0
;
double
centroidZ
=
0
;
for
(
int
i
=
0
;
i
<
los
.
size
();
++
i
)
{
final
Vector3D
p
=
positions
.
get
(
i
);
final
Vector3D
l
=
los
.
get
(
i
);
centroidX
+=
p
.
getX
()
+
l
.
getX
();
centroidY
+=
p
.
getY
()
+
l
.
getY
();
centroidZ
+=
p
.
getZ
()
+
l
.
getZ
();
centroidX
+=
(
p
.
getX
()
-
referencePoint
.
getX
())
+
l
.
getX
();
centroidY
+=
(
p
.
getY
()
-
referencePoint
.
getY
())
+
l
.
getY
();
centroidZ
+=
(
p
.
getZ
()
-
referencePoint
.
getZ
())
+
l
.
getZ
();
}
centroidX
/=
los
.
size
();
centroidY
/=
los
.
size
();
centroidZ
/=
los
.
size
();
referencePoint
=
new
Vector3D
(
centroidX
,
centroidY
,
centroidZ
);
// build a centered data matrix
final
RealMatrix
matrix
=
MatrixUtils
.
createRealMatrix
(
3
,
los
.
size
());
for
(
int
i
=
0
;
i
<
los
.
size
();
++
i
)
{
final
Vector3D
p
=
positions
.
get
(
i
);
final
Vector3D
l
=
los
.
get
(
i
);
matrix
.
setEntry
(
0
,
i
,
p
.
getX
()
+
l
.
getX
()
-
centroidX
);
matrix
.
setEntry
(
1
,
i
,
p
.
getY
()
+
l
.
getY
()
-
centroidY
);
matrix
.
setEntry
(
2
,
i
,
p
.
getZ
()
+
l
.
getZ
()
-
centroidZ
);
matrix
.
setEntry
(
0
,
i
,
(
p
.
getX
()
-
referencePoint
.
getX
())
+
l
.
getX
()
-
centroidX
);
matrix
.
setEntry
(
1
,
i
,
(
p
.
getY
()
-
referencePoint
.
getY
())
+
l
.
getY
()
-
centroidY
);
matrix
.
setEntry
(
2
,
i
,
(
p
.
getZ
()
-
referencePoint
.
getZ
())
+
l
.
getZ
()
-
centroidZ
);
}
// compute Singular Value Decomposition
...
...
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