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
ad4ba4ca
Commit
ad4ba4ca
authored
Jul 24, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testing old functions
parent
05489e74
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
15 deletions
+43
-15
align_functions.js
js/align_functions.js
+5
-0
numbers.calculus.extra.js
js/numbers/numbers.calculus.extra.js
+36
-13
ui_align.js
js/ui_align.js
+2
-2
No files found.
js/align_functions.js
View file @
ad4ba4ca
...
@@ -301,6 +301,11 @@ function hll3_w_i(i,v){
...
@@ -301,6 +301,11 @@ function hll3_w_i(i,v){
}
}
/**
* Functions for position latitude and longitude (heading is fixed)
* hll3a_...
*/
/**
/**
...
...
js/numbers/numbers.calculus.extra.js
View file @
ad4ba4ca
...
@@ -40,8 +40,14 @@
...
@@ -40,8 +40,14 @@
*/
*/
numbers
.
calculus
.
GaussNewton
=
function
(
v
,
n
,
r
,
dr
,
eps
,
w
){
numbers
.
calculus
.
GaussNewton
=
function
(
v
,
n
,
r
,
dr
,
eps
,
w
){
// divide delta by 2
var
D_DIV
=
2
console
.
log
(
"Will divide delta by "
+
D_DIV
)
var
epsilon
=
eps
||
1
e
-
8
var
epsilon
=
eps
||
1
e
-
8
var
limit
=
1000
//var limit = 1000
var
limit
=
50
var
stop
=
false
var
stop
=
false
var
counter
=
0
var
counter
=
0
...
@@ -113,7 +119,7 @@ numbers.calculus.GaussNewton = function(v,n,r,dr,eps,w){
...
@@ -113,7 +119,7 @@ numbers.calculus.GaussNewton = function(v,n,r,dr,eps,w){
var
res
=
[]
var
res
=
[]
for
(
var
i
=
0
;
i
<
v
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
v
.
length
;
i
++
){
res
[
i
]
=
v
[
i
]
-
delta
[
i
][
0
]
res
[
i
]
=
v
[
i
]
-
delta
[
i
][
0
]
/
D_DIV
}
}
return
res
return
res
...
@@ -231,17 +237,24 @@ numbers.calculus.GaussNewton_nD = function(v,n,r,dr,eps,w){
...
@@ -231,17 +237,24 @@ numbers.calculus.GaussNewton_nD = function(v,n,r,dr,eps,w){
//functions
//functions
function
iterate
(
v
,
n
,
r
,
dr
){
function
iterate
(
v
,
n
,
r
,
dr
){
var
wsum
=
0
;
var
xn
=
r
.
length
;
var
wsum
=
0
var
J
=
[]
for
(
var
j
=
0
;
j
<
xn
;
j
++
){
for
(
var
j
=
0
;
j
<
xn
;
j
++
){
wsum
+=
ws
(
v
,
n
,
xn
)
wsum
+=
ws
(
v
,
n
,
j
)
J
=
J
.
concat
(
jacobian
(
v
,
n
,
dr
[
j
]))
}
}
var
J
=
jacobian
(
v
,
n
,
dr
)
console
.
log
(
J
)
var
Jt
=
numbers
.
matrix
.
transpose
(
J
)
var
Jt
=
numbers
.
matrix
.
transpose
(
J
)
for
(
var
i
=
0
;
i
<
n
;
i
++
){
for
(
var
j
=
0
;
j
<
xn
;
j
++
){
J
=
numbers
.
matrix
.
rowScale
(
J
,
i
,
wn
(
i
,
v
,
wsum
))
for
(
var
i
=
0
;
i
<
n
;
i
++
){
J
=
numbers
.
matrix
.
rowScale
(
J
,
n
*
j
+
i
,
wn
(
i
,
v
,
wsum
,
j
))
}
}
}
// JtJ
// JtJ
...
@@ -254,8 +267,10 @@ numbers.calculus.GaussNewton_nD = function(v,n,r,dr,eps,w){
...
@@ -254,8 +267,10 @@ numbers.calculus.GaussNewton_nD = function(v,n,r,dr,eps,w){
var
V
=
[]
var
V
=
[]
for
(
var
i
=
0
;
i
<
n
;
i
++
){
for
(
var
j
=
0
;
j
<
xn
;
j
++
){
V
.
push
([
wn
(
i
,
v
,
wsum
)
*
r
(
i
,
v
)])
for
(
var
i
=
0
;
i
<
n
;
i
++
){
V
.
push
([
wn
(
i
,
v
,
wsum
,
j
)
*
r
[
j
](
i
,
v
)])
}
}
}
var
delta
=
numbers
.
matrix
.
multiply
(
J
,
V
)
var
delta
=
numbers
.
matrix
.
multiply
(
J
,
V
)
...
@@ -275,12 +290,20 @@ numbers.calculus.GaussNewton_nD = function(v,n,r,dr,eps,w){
...
@@ -275,12 +290,20 @@ numbers.calculus.GaussNewton_nD = function(v,n,r,dr,eps,w){
function
sigma
(
v
,
n
,
r
){
function
sigma
(
v
,
n
,
r
){
var
xn
=
r
.
length
;
var
sum
=
0
var
sum
=
0
var
wsum
=
ws
(
v
,
n
)
for
(
var
i
=
0
;
i
<
n
;
i
++
){
var
wsum
=
0
;
sum
+=
wn
(
i
,
v
,
wsum
)
*
r
(
i
,
v
)
*
r
(
i
,
v
)
for
(
var
j
=
0
;
j
<
xn
;
j
++
){
//wsum += w(i,v)
wsum
+=
ws
(
v
,
n
,
j
)
}
for
(
var
j
=
0
;
j
<
xn
;
j
++
){
for
(
var
i
=
0
;
i
<
n
;
i
++
){
sum
+=
wn
(
i
,
v
,
wsum
,
j
)
*
r
[
j
](
i
,
v
)
*
r
[
j
](
i
,
v
)
//wsum += w(i,v)
}
}
}
//console.log("sum = "+sum+" wsum = "+wsum);
//console.log("sum = "+sum+" wsum = "+wsum);
...
...
js/ui_align.js
View file @
ad4ba4ca
...
@@ -403,13 +403,13 @@ function x3dom_align_hll3(){
...
@@ -403,13 +403,13 @@ function x3dom_align_hll3(){
var
result
=
numbers
.
calculus
.
GaussNewton
(
xyh
,
Data
.
markers
.
length
,
hll3_r_i
,[
hll3_dr_dx_i
,
hll3_dr_dy_i
],
epsilon
,
hll3_w_i
);
var
result
=
numbers
.
calculus
.
GaussNewton
(
xyh
,
Data
.
markers
.
length
,
hll3_r_i
,[
hll3_dr_dx_i
,
hll3_dr_dy_i
],
epsilon
,
hll3_w_i
);
/*
/*
var rs_i = [hll3_r_i,
hll3_r_i];
var rs_i = [hll3_r_i,hll3_r_i];
var drs_i = [
var drs_i = [
[hll3_dr_dx_i, hll3_dr_dy_i],
[hll3_dr_dx_i, hll3_dr_dy_i],
[hll3_dr_dx_i, hll3_dr_dy_i]
[hll3_dr_dx_i, hll3_dr_dy_i]
];
];
var ws_i = [hll3_w_i,
hll3_w_i];
var ws_i = [hll3_w_i,hll3_w_i];
var result = numbers.calculus.GaussNewton_nD(xyh,Data.markers.length,rs_i,drs_i,epsilon,ws_i);
var result = numbers.calculus.GaussNewton_nD(xyh,Data.markers.length,rs_i,drs_i,epsilon,ws_i);
*/
*/
...
...
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