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.
33 lines
698 B
33 lines
698 B
module.exports = rotate
|
|
|
|
/**
|
|
* Rotates a mat3 by the given angle
|
|
*
|
|
* @alias mat3.rotate
|
|
* @param {mat3} out the receiving matrix
|
|
* @param {mat3} a the matrix to rotate
|
|
* @param {Number} rad the angle to rotate the matrix by
|
|
* @returns {mat3} out
|
|
*/
|
|
function rotate(out, a, rad) {
|
|
var a00 = a[0], a01 = a[1], a02 = a[2]
|
|
var a10 = a[3], a11 = a[4], a12 = a[5]
|
|
var a20 = a[6], a21 = a[7], a22 = a[8]
|
|
|
|
var s = Math.sin(rad)
|
|
var c = Math.cos(rad)
|
|
|
|
out[0] = c * a00 + s * a10
|
|
out[1] = c * a01 + s * a11
|
|
out[2] = c * a02 + s * a12
|
|
|
|
out[3] = c * a10 - s * a00
|
|
out[4] = c * a11 - s * a01
|
|
out[5] = c * a12 - s * a02
|
|
|
|
out[6] = a20
|
|
out[7] = a21
|
|
out[8] = a22
|
|
|
|
return out
|
|
}
|
|
|