Vec

Generic struct that represents a vector holding size elements of type T. A vector must contain at least 1 element, and has no upper-bound on the size beyond restrictions imposed by the system.

Constructors

this
this(T[size] elements)

Constructs a vector from an array of elements.

this
this(T[] elements)

Constructs a vector from a variadic list of elements.

this
this(T value)

Constructs a vector where all elements have the given value.

this
this(Vec!(T, size) other)

Constructs a vector as a copy of the other.

Members

Aliases

divide
alias divide = div
Undocumented in source.
dotProduct
alias dotProduct = dot
Undocumented in source.
len
alias len = mag
Undocumented in source.
length
alias length = mag
Undocumented in source.
magnitude
alias magnitude = mag
Undocumented in source.
multiply
alias multiply = mul
Undocumented in source.
normalize
alias normalize = norm
Undocumented in source.
subtract
alias subtract = sub
Undocumented in source.

Functions

add
void add(Vec!(V, size) other)
Undocumented in source. Be warned that the author may not have intended to support it.
div
void div(V factor)
Undocumented in source. Be warned that the author may not have intended to support it.
dot
T dot(Vec!(T, size) other)
Undocumented in source. Be warned that the author may not have intended to support it.
mag
double mag()
Undocumented in source. Be warned that the author may not have intended to support it.
mul
void mul(V factor)
Undocumented in source. Be warned that the author may not have intended to support it.
norm
void norm()
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
T opIndex(size_t i)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndexAssign
void opIndexAssign(T value, size_t i)
Undocumented in source. Be warned that the author may not have intended to support it.
sub
void sub(Vec!(V, size) other)
Undocumented in source. Be warned that the author may not have intended to support it.
toCartesian
void toCartesian()
Undocumented in source. Be warned that the author may not have intended to support it.
toPolar
void toPolar()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

empty
Vec!(T, size) empty()

Constructs a vector containing all 0's.

Static variables

SIZE
size_t SIZE;

A static contstant that can be used to get the size of the vector.

Variables

data
T[size] data;

The internal static array storing the elements of this vector.

Meta