Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x3domlet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
x3domlet
Commits
ae181bee
Commit
ae181bee
authored
Nov 13, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testing?
parent
b2381402
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
15 deletions
+51
-15
x3dom_deltas.js
js/x3dom_deltas.js
+51
-15
No files found.
js/x3dom_deltas.js
View file @
ae181bee
...
@@ -34,12 +34,14 @@ function x3dom_delta_markers(){
...
@@ -34,12 +34,14 @@ function x3dom_delta_markers(){
//var e2_scale = e2_abc.join(",");
//var e2_scale = e2_abc.join(",");
//x3dom_draw_ellipsoid("e2","green",e2_c.toString(),"",e2_scale);
//x3dom_draw_ellipsoid("e2","green",e2_c.toString(),"",e2_scale);
/*
x3dom_draw_ellipsoid_by_semiaxes_and_center("e2","green",{
x3dom_draw_ellipsoid_by_semiaxes_and_center("e2","green",{
O: e2_c,
O: e2_c,
Ox: new x3dom.fields.SFVec3f(e2_abc[0], 0, 0),
Ox: new x3dom.fields.SFVec3f(e2_abc[0], 0, 0),
Oy: new x3dom.fields.SFVec3f( 0, e2_abc[1], 0),
Oy: new x3dom.fields.SFVec3f( 0, e2_abc[1], 0),
Oz: new x3dom.fields.SFVec3f( 0, 0, e2_abc[2])
Oz: new x3dom.fields.SFVec3f( 0, 0, e2_abc[2])
},transparency=0.5);
},transparency=0.5);
*/
var
RE2
=
x3dom
.
fields
.
SFMatrix4f
.
identity
();
var
RE2
=
x3dom
.
fields
.
SFMatrix4f
.
identity
();
//RE2.setValue(xa,ya,za);
//RE2.setValue(xa,ya,za);
...
@@ -64,12 +66,14 @@ function x3dom_delta_markers(){
...
@@ -64,12 +66,14 @@ function x3dom_delta_markers(){
$
(
"#helper_line0"
).
remove
();
$
(
"#helper_line0"
).
remove
();
$
(
"#helper_line1"
).
remove
();
$
(
"#helper_line1"
).
remove
();
$
(
"#helper_line3"
).
remove
();
// e1 direction
// e1 direction
x3dom_draw_line
(
"helper_line0"
,
"white"
,
e1_c
,
new
x3dom
.
fields
.
SFVec3f
(
0
,
0
,
0
));
//
x3dom_draw_line("helper_line0","white", e1_c, new x3dom.fields.SFVec3f(0,0,0));
// e1 direction from e2_c
// e1 direction from e2_c
x3dom_draw_line
(
"helper_line1"
,
"white"
,
e2_c
.
add
(
e1_c
),
e2_c
.
subtract
(
e1_c
));
//
x3dom_draw_line("helper_line1","white", e2_c.add(e1_c), e2_c.subtract(e1_c));
x3dom_draw_line
(
"helper_line3"
,
"white"
,
e1_c
,
e2_c
);
// E1: draw tilted ellipsoid
// E1: draw tilted ellipsoid
...
@@ -94,12 +98,14 @@ function x3dom_delta_markers(){
...
@@ -94,12 +98,14 @@ function x3dom_delta_markers(){
console
.
log
(
RE1
.
toString
());
console
.
log
(
RE1
.
toString
());
/*
x3dom_draw_ellipsoid_by_semiaxes_and_center("e1b","green",{
x3dom_draw_ellipsoid_by_semiaxes_and_center("e1b","green",{
O: e2_c,
O: e2_c,
Ox: xa.multiply(e1_abc[0]),
Ox: xa.multiply(e1_abc[0]),
Oy: ya.multiply(e1_abc[1]),
Oy: ya.multiply(e1_abc[1]),
Oz: za.multiply(e1_abc[2])
Oz: za.multiply(e1_abc[2])
},
transparency
=
0.0
);
},transparency=0.5);
*/
// now let's get to covariance matrix
// now let's get to covariance matrix
var
JE1
=
x3dom_ellipsoid_inertia_tensor_v2
(
1
,
e1_abc
[
0
],
e1_abc
[
1
],
e1_abc
[
2
]);
var
JE1
=
x3dom_ellipsoid_inertia_tensor_v2
(
1
,
e1_abc
[
0
],
e1_abc
[
1
],
e1_abc
[
2
]);
...
@@ -112,34 +118,64 @@ function x3dom_delta_markers(){
...
@@ -112,34 +118,64 @@ function x3dom_delta_markers(){
var
C2
=
RE2xJE2
.
mult
(
RE2xJE2
.
transpose
());
var
C2
=
RE2xJE2
.
mult
(
RE2xJE2
.
transpose
());
var
C
=
C1
.
add
(
C2
);
var
C
=
C1
.
add
(
C2
);
// testing
//var C = C1.add(C1);
//var C = C1.add(C1);
Cn
=
matrix_x3dom_to_numeric
(
C
);
Cn
=
matrix_x3dom_to_numeric
(
C
);
Bn
=
numeric
.
eig
(
Cn
);
Bn
=
numeric
.
eig
(
Cn
);
console
.
log
(
Bn
);
//
console.log(Bn);
var
e
e
_a
=
Math
.
sqrt
(
Bn
.
lambda
.
x
[
0
]);
var
e
s
_a
=
Math
.
sqrt
(
Bn
.
lambda
.
x
[
0
]);
var
e
e
_b
=
Math
.
sqrt
(
Bn
.
lambda
.
x
[
1
]);
var
e
s
_b
=
Math
.
sqrt
(
Bn
.
lambda
.
x
[
1
]);
var
e
e
_c
=
Math
.
sqrt
(
Bn
.
lambda
.
x
[
2
]);
var
e
s
_c
=
Math
.
sqrt
(
Bn
.
lambda
.
x
[
2
]);
console
.
log
(
"e1 restored abc: "
+
[
e
e_a
,
ee_b
,
ee
_c
].
join
(
" "
));
console
.
log
(
"e1 restored abc: "
+
[
e
s_a
,
es_b
,
es
_c
].
join
(
" "
));
var
RE
1n
=
new
x3dom
.
fields
.
SFMatrix4f
(
var
RE
S
=
new
x3dom
.
fields
.
SFMatrix4f
(
Bn
.
E
.
x
[
0
][
0
],
Bn
.
E
.
x
[
0
][
1
],
Bn
.
E
.
x
[
0
][
2
],
0
,
Bn
.
E
.
x
[
0
][
0
],
Bn
.
E
.
x
[
0
][
1
],
Bn
.
E
.
x
[
0
][
2
],
0
,
Bn
.
E
.
x
[
1
][
0
],
Bn
.
E
.
x
[
1
][
1
],
Bn
.
E
.
x
[
1
][
2
],
0
,
Bn
.
E
.
x
[
1
][
0
],
Bn
.
E
.
x
[
1
][
1
],
Bn
.
E
.
x
[
1
][
2
],
0
,
Bn
.
E
.
x
[
2
][
0
],
Bn
.
E
.
x
[
2
][
1
],
Bn
.
E
.
x
[
2
][
2
],
0
,
Bn
.
E
.
x
[
2
][
0
],
Bn
.
E
.
x
[
2
][
1
],
Bn
.
E
.
x
[
2
][
2
],
0
,
0
,
0
,
0
,
1
0
,
0
,
0
,
1
);
);
console
.
log
(
RE
1n
.
toString
());
console
.
log
(
RE
S
.
toString
());
x3dom_draw_ellipsoid_by_semiaxes_and_center
(
"e1c"
,
"red"
,{
x3dom_draw_ellipsoid_by_semiaxes_and_center
(
"e1c"
,
"red"
,{
O
:
e2_c
,
O
:
e2_c
,
Ox
:
RE1n
.
e0
().
multiply
(
ee_a
),
Ox
:
RES
.
e0
().
multiply
(
es_a
),
Oy
:
RE1n
.
e1
().
multiply
(
ee_b
),
Oy
:
RES
.
e1
().
multiply
(
es_b
),
Oz
:
RE1n
.
e2
().
multiply
(
ee_c
)
Oz
:
RES
.
e2
().
multiply
(
es_c
)
},
transparency
=
0.5
);
},
transparency
=
0.7
);
// now get error:
// we have:
// 1. e1_c
// 2. RES and es_a, es_b, es_c
// RES x e1_c
var
RESi
=
RES
.
inverse
();
var
E
=
RESi
.
multMatrixVec
(
e1_c
.
subtract
(
e2_c
));
console
.
log
(
"delta vector in ellipsoid:"
);
console
.
log
(
E
.
toString
());
E
=
E
.
multComponents
(
new
x3dom
.
fields
.
SFVec3f
(
1
/
es_a
,
1
/
es_b
,
1
/
es_c
));
console
.
log
(
E
.
toString
());
console
.
log
(
E
.
length
()
*
E
.
length
());
// scale the result ellipsoid so it with touch another marker
// and it did - it only tests that the scale is correct
x3dom_draw_ellipsoid_by_semiaxes_and_center
(
"e1d"
,
"gold"
,{
O
:
e2_c
,
Ox
:
RES
.
e0
().
multiply
(
E
.
length
()
*
es_a
),
Oy
:
RES
.
e1
().
multiply
(
E
.
length
()
*
es_b
),
Oz
:
RES
.
e2
().
multiply
(
E
.
length
()
*
es_c
)
},
transparency
=
0.7
);
return
0
;
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