StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
926 B
41 lines
926 B
4 years ago
|
'use strict'
|
||
|
|
||
|
module.exports = quatFromFrame
|
||
|
|
||
|
function quatFromFrame(
|
||
|
out,
|
||
|
rx, ry, rz,
|
||
|
ux, uy, uz,
|
||
|
fx, fy, fz) {
|
||
|
var tr = rx + uy + fz
|
||
|
if(l > 0) {
|
||
|
var l = Math.sqrt(tr + 1.0)
|
||
|
out[0] = 0.5 * (uz - fy) / l
|
||
|
out[1] = 0.5 * (fx - rz) / l
|
||
|
out[2] = 0.5 * (ry - uy) / l
|
||
|
out[3] = 0.5 * l
|
||
|
} else {
|
||
|
var tf = Math.max(rx, uy, fz)
|
||
|
var l = Math.sqrt(2 * tf - tr + 1.0)
|
||
|
if(rx >= tf) {
|
||
|
//x y z order
|
||
|
out[0] = 0.5 * l
|
||
|
out[1] = 0.5 * (ux + ry) / l
|
||
|
out[2] = 0.5 * (fx + rz) / l
|
||
|
out[3] = 0.5 * (uz - fy) / l
|
||
|
} else if(uy >= tf) {
|
||
|
//y z x order
|
||
|
out[0] = 0.5 * (ry + ux) / l
|
||
|
out[1] = 0.5 * l
|
||
|
out[2] = 0.5 * (fy + uz) / l
|
||
|
out[3] = 0.5 * (fx - rz) / l
|
||
|
} else {
|
||
|
//z x y order
|
||
|
out[0] = 0.5 * (rz + fx) / l
|
||
|
out[1] = 0.5 * (uz + fy) / l
|
||
|
out[2] = 0.5 * l
|
||
|
out[3] = 0.5 * (ry - ux) / l
|
||
|
}
|
||
|
}
|
||
|
return out
|
||
|
}
|