transpose

Transpose /// //////////////

transpose
(
Matrix
)
(
Matrix mat
)
if (
isMatrix!Matrix
)

Examples

Unittest transpose

1 mat2 m2 = mat2( 1.0f );
2 assert( m2.transpose.data == mat2( 1.0f ).data );
3 
4 assert( m2.transpose.data  ==  [[ 1.0f, 0.0f ],
5 								[ 0.0f, 1.0f ]] );
6 assert( m2.data == mat2.identity.data );
7 
8 mat3 m3 = mat3( 1.1f, 1.2f, 1.3f,
9 				2.1f, 2.2f, 2.3f,
10 				3.1f, 3.2f, 3.3f );
11 m3 = m3.transpose;
12 assert( m3.data == [[ 1.1f, 2.1f, 3.1f ],
13 					[ 1.2f, 2.2f, 3.2f ],
14 					[ 1.3f, 2.3f, 3.3f ]] );
15 
16 mat4 m4 = mat4( 2.0f );
17 assert( m4.transpose.data == mat4( 2.0f ).data );

Meta