gfm.math.vector

N-dimension vector mathematical object

Members

Aliases

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

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

Enums

isVector
eponymoustemplate 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)

Angle between two vectors

cross
Vector!(T, 3) cross(const Vector!(T, 3) a, const Vector!(T, 3) b)

Cross product of two 3D vectors

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

Dot product of two vectors

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.

Templates

vec2
template vec2(T)
vec3
template vec3(T)
vec4
template vec4(T)

Meta