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
760d94bb
Commit
760d94bb
authored
Jul 26, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. weights 2. zNear fixe
parent
38c56432
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
16 deletions
+35
-16
align_functions.js
js/align_functions.js
+14
-4
numbers.calculus.extra.js
js/numbers/numbers.calculus.extra.js
+12
-4
ui_align.js
js/ui_align.js
+2
-2
x3dom_functions.js
js/x3dom_functions.js
+7
-6
No files found.
js/align_functions.js
View file @
760d94bb
...
@@ -170,6 +170,13 @@ function hll_dr_dh_i(i,v){
...
@@ -170,6 +170,13 @@ function hll_dr_dh_i(i,v){
return
1
;
return
1
;
}
}
/**
* weight function
*/
function
hll_w_i
(
i
,
v
){
return
1
;
}
/**
/**
* Functions for relative altitude, tilt and roll
* Functions for relative altitude, tilt and roll
...
@@ -203,7 +210,7 @@ function art_r_i(i,v){
...
@@ -203,7 +210,7 @@ function art_r_i(i,v){
var
f1
=
art_f_3d_i
(
i
,
v
);
var
f1
=
art_f_3d_i
(
i
,
v
);
var
f2
=
art_f_map_i
(
i
,
v
);
var
f2
=
art_f_map_i
(
i
,
v
);
//return (f1-f2+360)%360;
//return (f1-f2+360)%360;
return
(
f1
-
f2
)
/
art_l_i
(
i
)
;
return
(
f1
-
f2
);
}
}
function
art_dr_dx_i
(
i
,
v
){
function
art_dr_dx_i
(
i
,
v
){
...
@@ -217,7 +224,7 @@ function art_dr_dx_i(i,v){
...
@@ -217,7 +224,7 @@ function art_dr_dx_i(i,v){
res
+=
-
Math
.
sin
(
v
[
0
])
*
Math
.
cos
(
v
[
1
])
*
yi
;
res
+=
-
Math
.
sin
(
v
[
0
])
*
Math
.
cos
(
v
[
1
])
*
yi
;
res
+=
-
Math
.
cos
(
v
[
0
])
*
zi
;
res
+=
-
Math
.
cos
(
v
[
0
])
*
zi
;
return
res
/
art_l_i
(
i
)
;
return
res
;
}
}
...
@@ -231,7 +238,7 @@ function art_dr_dy_i(i,v){
...
@@ -231,7 +238,7 @@ function art_dr_dy_i(i,v){
var
res
=
-
Math
.
cos
(
v
[
0
])
*
Math
.
cos
(
v
[
1
])
*
xi
;
var
res
=
-
Math
.
cos
(
v
[
0
])
*
Math
.
cos
(
v
[
1
])
*
xi
;
res
+=
-
Math
.
cos
(
v
[
0
])
*
Math
.
sin
(
v
[
1
])
*
yi
;
res
+=
-
Math
.
cos
(
v
[
0
])
*
Math
.
sin
(
v
[
1
])
*
yi
;
return
res
/
art_l_i
(
i
)
;
return
res
;
}
}
...
@@ -246,7 +253,10 @@ function art_l_i(i){
...
@@ -246,7 +253,10 @@ function art_l_i(i){
var
yi
=
mark
.
align
.
y
;
var
yi
=
mark
.
align
.
y
;
var
zi
=
mark
.
align
.
z
;
var
zi
=
mark
.
align
.
z
;
return
Math
.
sqrt
(
xi
*
xi
+
yi
*
yi
+
zi
*
zi
);
return
Math
.
sqrt
(
Math
.
pow
(
xi
,
2
)
+
Math
.
pow
(
yi
,
2
)
+
Math
.
pow
(
zi
,
2
)
);
}
}
function
art_w_i
(
i
,
v
){
return
1
/
art_l_i
(
i
);
}
js/numbers/numbers.calculus.extra.js
View file @
760d94bb
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
* @eps {Number} precision
* @eps {Number} precision
*
*
*/
*/
numbers
.
calculus
.
GaussNewton
=
function
(
v
,
n
,
r
,
dr
,
eps
){
numbers
.
calculus
.
GaussNewton
=
function
(
v
,
n
,
r
,
dr
,
eps
,
w
){
var
epsilon
=
eps
||
1
e
-
8
var
epsilon
=
eps
||
1
e
-
8
var
limit
=
1000
var
limit
=
1000
...
@@ -47,6 +47,12 @@ numbers.calculus.GaussNewton = function(v,n,r,dr,eps){
...
@@ -47,6 +47,12 @@ numbers.calculus.GaussNewton = function(v,n,r,dr,eps){
var
counter
=
0
var
counter
=
0
var
v0
=
v
var
v0
=
v
if
(
w
===
undefined
){
w
=
function
(){
return
1
;
};
}
while
(
!
stop
){
while
(
!
stop
){
counter
++
counter
++
...
@@ -102,13 +108,15 @@ numbers.calculus.GaussNewton = function(v,n,r,dr,eps){
...
@@ -102,13 +108,15 @@ numbers.calculus.GaussNewton = function(v,n,r,dr,eps){
function
sigma
(
v
,
n
,
r
){
function
sigma
(
v
,
n
,
r
){
var
sum
=
0
;
var
sum
=
0
var
wsum
=
0
for
(
var
i
=
0
;
i
<
n
;
i
++
){
for
(
var
i
=
0
;
i
<
n
;
i
++
){
sum
+=
r
(
i
,
v
)
*
r
(
i
,
v
)
sum
+=
r
(
i
,
v
)
*
r
(
i
,
v
)
wsum
+=
w
(
i
,
v
)
}
}
sum
=
Math
.
sqrt
(
sum
/
n
)
sum
=
Math
.
sqrt
(
sum
/
wsum
)
return
sum
return
sum
...
@@ -122,7 +130,7 @@ numbers.calculus.GaussNewton = function(v,n,r,dr,eps){
...
@@ -122,7 +130,7 @@ numbers.calculus.GaussNewton = function(v,n,r,dr,eps){
var
row
=
[]
var
row
=
[]
for
(
var
j
=
0
;
j
<
dr
.
length
;
j
++
){
for
(
var
j
=
0
;
j
<
dr
.
length
;
j
++
){
row
.
push
(
dr
[
j
](
i
,
v
))
row
.
push
(
w
(
i
,
v
)
*
dr
[
j
](
i
,
v
))
}
}
J
[
i
]
=
row
J
[
i
]
=
row
...
...
js/ui_align.js
View file @
760d94bb
...
@@ -131,7 +131,7 @@ function x3dom_align_hll(){
...
@@ -131,7 +131,7 @@ function x3dom_align_hll(){
var
xyh
=
[
x0
,
y0
,(
h0
>
180
)?
h0
-
360
:
h0
];
var
xyh
=
[
x0
,
y0
,(
h0
>
180
)?
h0
-
360
:
h0
];
var
result
=
numbers
.
calculus
.
GaussNewton
(
xyh
,
Data
.
markers
.
length
,
hll_r_i
,[
hll_dr_dx_i
,
hll_dr_dy_i
,
hll_dr_dh_i
],
epsilon
);
var
result
=
numbers
.
calculus
.
GaussNewton
(
xyh
,
Data
.
markers
.
length
,
hll_r_i
,[
hll_dr_dx_i
,
hll_dr_dy_i
,
hll_dr_dh_i
],
epsilon
,
hll_w_i
);
xyh
=
result
.
v
;
xyh
=
result
.
v
;
var
s1
=
result
.
error
;
var
s1
=
result
.
error
;
...
@@ -271,7 +271,7 @@ function x3dom_align_art(){
...
@@ -271,7 +271,7 @@ function x3dom_align_art(){
}
}
var
epsilon
=
1
e
-
8
;
var
epsilon
=
1
e
-
8
;
var
result
=
numbers
.
calculus
.
GaussNewton
([
0
,
0
,
0
],
Data
.
markers
.
length
,
art_r_i
,[
art_dr_dx_i
,
art_dr_dy_i
,
art_dr_da_i
],
epsilon
);
var
result
=
numbers
.
calculus
.
GaussNewton
([
0
,
0
,
0
],
Data
.
markers
.
length
,
art_r_i
,[
art_dr_dx_i
,
art_dr_dy_i
,
art_dr_da_i
],
epsilon
,
art_w_i
);
console
.
log
(
result
);
console
.
log
(
result
);
...
...
js/x3dom_functions.js
View file @
760d94bb
...
@@ -99,7 +99,7 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
...
@@ -99,7 +99,7 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
y
=
xyz
[
1
];
y
=
xyz
[
1
];
z
=
xyz
[
2
];
z
=
xyz
[
2
];
dist_xz
=
Math
.
sqrt
(
Math
.
pow
(
x
-
xc
,
2
)
+
Math
.
pow
(
z
-
zc
,
2
));
//
dist_xz = Math.sqrt(Math.pow(x-xc,2)+Math.pow(z-zc,2));
}
else
{
}
else
{
...
@@ -107,16 +107,17 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
...
@@ -107,16 +107,17 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
y
=
Data
.
markers
[
index
].
y
;
y
=
Data
.
markers
[
index
].
y
;
z
=
Data
.
markers
[
index
].
z
;
z
=
Data
.
markers
[
index
].
z
;
/*
dist_xz = Data.markers[index].d_x3d;
dist_xz = Data.markers[index].d_x3d;
if (isNaN(dist_xz)){
if (isNaN(dist_xz)){
dist_xz = Math.sqrt(Math.pow(x-xc,2)+Math.pow(z-zc,2));;
dist_xz = Math.sqrt(Math.pow(x-xc,2)+Math.pow(z-zc,2));;
}
}
*/
}
}
dist_xyz
=
Math
.
sqrt
(
Math
.
pow
(
y
-
yc
,
2
)
+
Math
.
pow
(
dist_xz
,
2
));
//
dist_xyz = Math.sqrt(Math.pow(y-yc,2)+Math.pow(dist_xz,2));
id
=
$
(
shootRay
.
pickObject
).
attr
(
"id"
);
id
=
$
(
shootRay
.
pickObject
).
attr
(
"id"
);
}
else
{
}
else
{
var
viewingRay
=
elem
.
runtime
.
getViewingRay
(
cnvx
,
cnvy
);
var
viewingRay
=
elem
.
runtime
.
getViewingRay
(
cnvx
,
cnvy
);
...
@@ -125,14 +126,14 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
...
@@ -125,14 +126,14 @@ function x3dom_getXYPosOr(cnvx,cnvy,round){
y
=
viewingRay
.
dir
.
y
;
y
=
viewingRay
.
dir
.
y
;
z
=
viewingRay
.
dir
.
z
;
z
=
viewingRay
.
dir
.
z
;
dist_xz
=
null
;
//
dist_xz = null;
dist_xyz
=
null
;
//
dist_xyz = null;
valid_distance
=
false
;
valid_distance
=
false
;
}
}
var
R0
=
Data
.
camera
.
Matrices
.
R0
;
var
R0
=
Data
.
camera
.
Matrices
.
R0
;
var
p_w
=
new
x3dom
.
fields
.
SFVec3f
(
x
,
y
,
z
);
var
p_w
=
new
x3dom
.
fields
.
SFVec3f
(
x
-
xc
,
y
-
yc
,
z
-
zc
);
var
p_rw
=
R0
.
multMatrixVec
(
p_w
);
var
p_rw
=
R0
.
multMatrixVec
(
p_w
);
if
(
valid_distance
){
if
(
valid_distance
){
...
...
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