コード例 #1
0
ファイル: mat4.py プロジェクト: Shikhar8990/pChop
def det(m):
    ((m00, m01, m02, m03), (m10, m11, m12, m13), (m20, m21, m22, m23),
     (m30, m31, m32, m33)) = m

    a = m00 * mat3.det(((m11, m12, m13), (m21, m22, m23), (m31, m32, m33)))
    b = m10 * mat3.det(((m01, m02, m03), (m21, m22, m23), (m31, m32, m33)))
    c = m20 * mat3.det(((m01, m02, m03), (m11, m12, m13), (m31, m32, m33)))
    d = m30 * mat3.det(((m01, m02, m03), (m11, m12, m13), (m21, m22, m23)))

    return a - b + c - d
コード例 #2
0
ファイル: mat4.py プロジェクト: CRYPTOlab/klee
def det(m):
	((m00,m01,m02,m03),	
	 (m10,m11,m12,m13),	
	 (m20,m21,m22,m23),	
	 (m30,m31,m32,m33))= m
	 
	a= m00 * mat3.det(	((m11, m12, m13), 
						 (m21, m22, m23), 
						 (m31, m32, m33)) );
	b= m10 * mat3.det(	((m01, m02, m03), 
						 (m21, m22, m23), 
						 (m31, m32, m33)) );
	c= m20 * mat3.det(  ((m01, m02, m03), 
						 (m11, m12, m13), 
						 (m31, m32, m33)) );
	d= m30 * mat3.det(	((m01, m02, m03), 
						 (m11, m12, m13), 
						 (m21, m22, m23)) );
	
	return a-b+c-d;
コード例 #3
0
ファイル: mat4.py プロジェクト: fwibstwia/Workspace
def adj(m):
	((m00,m01,m02,m03),	
	 (m10,m11,m12,m13),	
	 (m20,m21,m22,m23),	
	 (m30,m31,m32,m33))= m
	 
	t00=  mat3.det( ((m11, m12, m13), 
					 (m21, m22, m23),
					 (m31, m32, m33)) )
	t01= -mat3.det( ((m10, m12, m13), 
					 (m20, m22, m23),
					 (m30, m32, m33)) )
	t02=  mat3.det( ((m10, m11, m13), 
					 (m20, m21, m23),
					 (m30, m31, m33)) )
	t03= -mat3.det( ((m10, m11, m12), 
					 (m20, m21, m22),
					 (m30, m31, m32)) )


	t10= -mat3.det( ((m01, m02, m03), 
					 (m21, m22, m23),
					 (m31, m32, m33)) )
	t11=  mat3.det( ((m00, m02, m03), 
					 (m20, m22, m23),
					 (m30, m32, m33)) )
	t12= -mat3.det( ((m00, m01, m03), 
					 (m20, m21, m23),
					 (m30, m31, m33)) )
	t13=  mat3.det( ((m00, m01, m02), 
					 (m20, m21, m22),
					 (m30, m31, m32)) )

	t20=  mat3.det( ((m01, m02, m03), 
					 (m11, m12, m13),
					 (m31, m32, m33)) )
	t21= -mat3.det( ((m00, m02, m03), 
					 (m10, m12, m13),
					 (m30, m32, m33)) )
	t22=  mat3.det( ((m00, m01, m03), 
					 (m10, m11, m13),
					 (m30, m31, m33)) )
	t23= -mat3.det( ((m00, m01, m02), 
					 (m10, m11, m12),
					 (m30, m31, m32)) )

	t30= -mat3.det( ((m01, m02, m03), 
					 (m11, m12, m13),
					 (m21, m22, m23)) )
	t31=  mat3.det( ((m00, m02, m03), 
					 (m10, m12, m13),
					 (m20, m22, m23)) )
	t32= -mat3.det( ((m00, m01, m03), 
					 (m10, m11, m13),
					 (m20, m21, m23)) )
	t33=  mat3.det( ((m00, m01, m02), 
					 (m10, m11, m12),
					 (m20, m21, m22)) )
					
	return ((t00,t01,t02,t03),
			(t10,t11,t12,t13),
			(t20,t21,t22,t23),
			(t30,t31,t32,t33))