B2G/gecko/browser/devtools/tilt/TiltMath.jsm
/**
   * Calculate the length of a quat4.
   *
   * @param {Array} aQuat
   *                quat4 to calculate the length of
   *
   * @return {Number} length of the quaternion
   */
Calculate the length of a quat4.
@param {Array} aQuat
quat4 to calculate the length of

@return {Number} length of the quaternion
Calculate the length of a quat4 . @param { Array } aQuat quat4 to calculate the length of @return { Number } length of the quaternion
function Q4_length(aQuat)
  {
    let x = aQuat[0];
    let y = aQuat[1];
    let z = aQuat[2];
    let w = aQuat[3];
    return Math.sqrt(x * x + y * y + z * z + w * w);
  }
function Q4_length ( aQuat ) { let x = aQuat [ 0 ] ; let y = aQuat [ 1 ] ; let z = aQuat [ 2 ] ; let w = aQuat [ 3 ] ; return Math . sqrt ( x * x + y * y + z * z + w * w ) ; }
Calculate the length of a quat4.
Calculate the length of a quat4 .