dist/server-module/lance-gg.js
/**
     * return an axis-angle representation of this quaternion
     *
     * @return {Object} contains two attributes: axis (ThreeVector) and angle.
     */
return an axis-angle representation of this quaternion
@return {Object} contains two attributes: axis (ThreeVector) and angle.
return an axis - angle representation of this quaternion @return { Object } contains two attributes : axis ( ThreeVector ) and angle .
toAxisAngle() {
        let axis = new ThreeVector(1, 0, 0);
        this.normalize();
        let angle = 2 * Math.acos(this.w);
        let s = Math.sqrt(1 - this.w * this.w);
        if (s > 0.001) {
            let divS = 1 / s;
            axis.x = this.x * divS;
            axis.y = this.y * divS;
            axis.z = this.z * divS;
        }
        if (s > Math.PI) {
            s -= 2 * Math.PI;
        }
        return { axis, angle };
    }
toAxisAngle ( ) { let axis = new ThreeVector ( 1 , 0 , 0 ) ; this . normalize ( ) ; let angle = 2 * Math . acos ( this . w ) ; let s = Math . sqrt ( 1 - this . w * this . w ) ; if ( s > 0.001 ) { let divS = 1 / s ; axis . x = this . x * divS ; axis . y = this . y * divS ; axis . z = this . z * divS ; } if ( s > Math . PI ) { s -= 2 * Math . PI ; } return { axis , angle } ; }
return an axis-angle representation of this quaternion
 @return {Object} contains two attributes: axis (ThreeVector) and angle.
return an axis - angle representation of this quaternion @return { Object } contains two attributes : axis ( ThreeVector ) and angle .
// assuming quaternion normalised then w is less than 1, so term always positive.