gfm.math.vector

Members

Aliases

DimensionType
alias DimensionType(T : Vector!U, U...) = U[0]

Get the numeric type used to measure a vectors's coordinates.

isVectorInstantiation
alias isVectorInstantiation(T) = isVector!T

True if T is some kind of Vector

Functions

absByElem
Vector!(T, N) absByElem(const Vector!(T, N) a)

Element-wise absolute value.

angleBetween
T angleBetween(const Vector!(T, N) a, const Vector!(T, N) b)
cross
Vector!(T, 3) cross(const Vector!(T, 3) a, const Vector!(T, 3) b)
dot
T dot(const Vector!(T, N) a, const Vector!(T, N) b)
maxByElem
Vector!(T, N) maxByElem(const Vector!(T, N) a, const Vector!(T, N) b)

Element-wise maximum.

minByElem
Vector!(T, N) minByElem(const Vector!(T, N) a, const Vector!(T, N) b)

Element-wise minimum.

reflect
Vector!(T, N) reflect(const Vector!(T, N) a, const Vector!(T, N) b)

3D reflect, like the GLSL function.

Structs

Vector
struct Vector(T, int N)

Generic 1D small vector.

Meta