1 auto x = vec3(1,0,0); 2 auto y = vecD(0,1,0); 3 auto z = vecD(0,0,1); 4 5 assert( eq( cross(x,y), z ) ); 6 assert( eq( cross(y,z), x ) ); 7 assert( eq( cross(y,x), -z ) ); 8 assert( eq( cross(x,z), -y ) ); 9 assert( eq( cross(z,x), y ) ); 10 11 auto fy = vecD(0,1,0,0); 12 assertThrown( x * fy ); 13 auto cfy = vec4(0,1,0,0); 14 static assert( !__traits(compiles,x*cfy) );
cross multiplication for compaitable vectors.