Vector

Vector structure. May include any numeric data type available for vector arithmetic.

Constructors

this
this(R x, R y)

Any numeric type that can be freely converted to a template vector type can be included in the vector's constructor.

this
this(R[2] arrvec)

Any numeric type that can be freely converted to a template vector type can be included in the vector's constructor.

Members

Aliases

Type
alias Type = T
Undocumented in source.

Functions

array
T[] array()

Converts a vector to an array.

length
T length()

Vector length.

negatived
Vector!T negatived()
Undocumented in source. Be warned that the author may not have intended to support it.
normalize
void normalize()

Normalizes the vector.

normalized
Vector!T normalized()

Returns a normalized vector.

opBinary
Vector!T opBinary(Vector rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
Vector!T opBinary(R num)
Undocumented in source. Be warned that the author may not have intended to support it.
opCmp
int opCmp(Vector rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Vector a, Vector b)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Vector other)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
T opIndex(size_t index)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndexAssign
void opIndexAssign(R value, size_t index)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(Vector rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(T num)
Undocumented in source. Be warned that the author may not have intended to support it.
positived
Vector!T positived()
Undocumented in source. Be warned that the author may not have intended to support it.

Templates

opUnary
template opUnary(string op)
Undocumented in source.

Variables

x
T x;

X-axis position.

y
T y;

Y-axis position.

Examples

assert(vec!float(32, 32) + vecf(32, 32) == Vector!float[64, 64]);

Meta