s[1] = q.y;
        axis[2] = q.z;
    }
    else
    {
        // http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/
        var s = Math.sqrt(1 - (q.w * q.w));
        axis[0] = q.x / s;
        axis[1] = q.y / s;
        axis[2] = q.z / s;
    }
    document.getElementById("resa").value = '{ [ '+toReal(axis[0])+', '+toReal(axis[1])+', '+toReal(axis[2])+' ], '+toReal(toAngle(angle))+' }';
    
    document.getElementById("resr").value = '[ '+toReal(toAngle(axis[0] * angl