def quatfrom_m33(m):
    (m0, m1, m2, m3, m4, m5, m6, m7, m8) = m
    trace = m0 + m4 + m8 + 1
    if trace > PRECISION:
        w = math.sqrt(trace) / 2
        x = (m5 - m7) / (4*w)
        y = (m6 - m2) / (4*w)
        z = (m1 - m3) / (4*w)
    else:
        if (m0 > m4) and (m0 > m8):
            s = math.sqrt( 1.0 + m0 - m4 - m8 ) * 2 # S=4*qx
            w = (m5 - m7) / s
            x = 0.25 * s
            y = (m3 + m1) / s
            z = (m6 + m2) / s
        elif m4 > m8:
            s = math.sqrt( 1.0 + m4 - m0 - m8 ) * 2 # S=4*qy
            w = (m6 - m2) / s
            x = (m3 + m1) / s
            y = 0.25 * s
            z = (m7 + m5) / s
        else:
            s = math.sqrt( 1.0 + m8 - m0 - m4 ) * 2 # S=4*qz
            w = (m1 - m3) / s
            x = (m6 + m2) / s
            y = (m7 + m5) / s
            z = 0.25 * s

    return quatnormalize((-x, -y, -z, w))
Returns the probability that a document with the given word is of the given type.
dataset/ETHPy150Open turbulenz/turbulenz_tools/turbulenz_tools/tools/vmath.py/quatfrom_m33--crossover with--dataset/ETHPy150Open clips/pattern/pattern/vector/__init__.py/Model.posterior_probability