def pat_matrix(m, dx, dy, dz):
 dxdy = ((- dx) * dy)
 dydz = ((- dy) * dz)
 dzdx = ((- dz) * dx)
 dxdx = (dx ** 2)
 dydy = (dy ** 2)
 dzdz = (dz ** 2)
 mat = (((dydy + dzdz), dxdy, dzdx), (dxdy, (dxdx + dzdz), dydz), (dzdx, dydz, (dydy + dxdx)))
 return (m * Matrix(mat))

def pat_matrix ( m , dx , dy , dz ) : dxdy = ( ( - dx ) * dy ) dydz = ( ( - dy ) * dz ) dzdx = ( ( - dz ) * dx ) dxdx = ( dx ** 2 ) dydy = ( dy ** 2 ) dzdz = ( dz ** 2 ) mat = ( ( ( dydy + dzdz ) , dxdy , dzdx ) , ( dxdy , ( dxdx + dzdz ) , dydz ) , ( dzdx , dydz , ( dydy + dxdx ) ) ) return ( m * Matrix ( mat ) )
returns the parallel axis theorem matrix to translate the inertia matrix a distance of for a body of mass m .