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.
29 lines
649 B
29 lines
649 B
4 years ago
|
module.exports = rotateY;
|
||
|
|
||
|
/**
|
||
|
* Rotate a 3D vector around the y-axis
|
||
|
* @param {vec3} out The receiving vec3
|
||
|
* @param {vec3} a The vec3 point to rotate
|
||
|
* @param {vec3} b The origin of the rotation
|
||
|
* @param {Number} c The angle of rotation
|
||
|
* @returns {vec3} out
|
||
|
*/
|
||
|
function rotateY(out, a, b, c){
|
||
|
var bx = b[0]
|
||
|
var bz = b[2]
|
||
|
|
||
|
// translate point to the origin
|
||
|
var px = a[0] - bx
|
||
|
var pz = a[2] - bz
|
||
|
|
||
|
var sc = Math.sin(c)
|
||
|
var cc = Math.cos(c)
|
||
|
|
||
|
// perform rotation and translate to correct position
|
||
|
out[0] = bx + pz * sc + px * cc
|
||
|
out[1] = a[1]
|
||
|
out[2] = bz + pz * cc - px * sc
|
||
|
|
||
|
return out
|
||
|
}
|