src/matrix.js
// changes for precision by fil@rezo.net
changes for precision by fil@rezo.net
changes for precision by fil@rezo . net
function RotationMatrix_fromAxisAngle(axis, angle) {
  const [n1, n2, n3] = cartesiand(axis),
    [n12, n22, n32] = [n1 * n1, n2 * n2, n3 * n3],
    c = cospi(angle / 180),
    s2 = (1 - c) / 2, 
    c2 = (1 + c) / 2, 
    sc = sinpi(angle / 180) / 2; 
  return [
    [
      (n12 - n32 - n22) * s2 + c2,
      2 * n1 * n2 * s2 + 2 * n3 * sc,
      2 * n1 * n3 * s2 - 2 * n2 * sc
    ],
    [
      2 * n1 * n2 * s2 - 2 * n3 * sc,
      (n22 - n32 - n12) * s2 + c2,
      2 * n2 * n3 * s2 + 2 * n1 * sc
    ],
    [
      2 * n1 * n3 * s2 + 2 * n2 * sc,
      2 * n2 * n3 * s2 - 2 * n1 * sc,
      (n32 - n22 - n12) * s2 + c2
    ]
  ];
}
function RotationMatrix_fromAxisAngle ( axis , angle ) { const [ n1 , n2 , n3 ] = cartesiand ( axis ) , [ n12 , n22 , n32 ] = [ n1 * n1 , n2 * n2 , n3 * n3 ] , c = cospi ( angle / 180 ) , s2 = ( 1 - c ) / 2 , c2 = ( 1 + c ) / 2 , sc = sinpi ( angle / 180 ) / 2 ; return [ [ ( n12 - n32 - n22 ) * s2 + c2 , 2 * n1 * n2 * s2 + 2 * n3 * sc , 2 * n1 * n3 * s2 - 2 * n2 * sc ] , [ 2 * n1 * n2 * s2 - 2 * n3 * sc , ( n22 - n32 - n12 ) * s2 + c2 , 2 * n2 * n3 * s2 + 2 * n1 * sc ] , [ 2 * n1 * n3 * s2 + 2 * n2 * sc , 2 * n2 * n3 * s2 - 2 * n1 * sc , ( n32 - n22 - n12 ) * s2 + c2 ] ] ; }
changes for precision by fil@rezo.net
changes for precision by fil@rezo . net
// cos(a/2)^2 // sin(a/2)^2 // sin(a/2)cos(a/2)