cross

Vector cross product

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

Members

Functions

cross
Vec!(T, 3) cross(Vec!(T, 3) lhs, Vec!(T, 3) rhs)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

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)));

Meta