Function cross

Vector cross product

Vec!(T,3) cross(T) (
  in Vec!(T,3) lhs,
  in Vec!(T,3) rhs
) pure nothrow @nogc @safe;

Example

import gfx.math.approx : approxUlp;

auto v1 = DVec3(12, 4, 3);
auto v2 = DVec3(-5, 3, 7);

assert(approxUlp(dot(v1, v2), -27));

auto v = DVec3(3, 4, 5);
assert(approxUlp(squaredMag(v), 50));

assert(approxUlp(normalize(FVec3(4, 0, 0)), FVec3(1, 0, 0)));