auto x = vec3(1,0,0); auto y = vecD(0,1,0); auto z = vecD(0,0,1); assert( eq( cross(x,y), z ) ); assert( eq( cross(y,z), x ) ); assert( eq( cross(y,x), -z ) ); assert( eq( cross(x,z), -y ) ); assert( eq( cross(z,x), y ) ); auto fy = vecD(0,1,0,0); assert( mustExcept({ auto fz = x * fy; }) ); auto cfy = vec4(0,1,0,0); static assert( !__traits(compiles,x*cfy) );
cross multiplication for compaitable vectors.