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.

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(T 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(T 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.

Variables

x
T x;

X-axis position.

y
T y;

Y-axis position.

Meta