Vector2

Utility template struct for manipulating 2-dimensional vectors

Vector2 is a simple class that defines a mathematical vector with two coordinates (x and y).

It can be used to represent anything that has two dimensions: a size, a point, a velocity, etc.

The template parameter T is the type of the coordinates. It can be any type that supports arithmetic operations (+, -, /, *) and comparisons (==, !=), for example int or float.

Constructors

this
this(T X, T Y)

Construct the vector from its coordinates

this
this(Vector2!(E) otherVector)

Construct the vector from another type of vector

Members

Functions

opAssign
Vector2!(T) opAssign(Vector2!(E) otherVector)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
Vector2!(T) opBinary(Vector2!(E) otherVector)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
Vector2!(T) opBinary(E num)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Vector2!(E) otherVector)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
Vector2!(T) opOpAssign(Vector2!(E) otherVector)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
Vector2!(T) opOpAssign(E num)
Undocumented in source. Be warned that the author may not have intended to support it.
opUnary
Vector2!(T) opUnary()
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.

Variables

x
T x;

X coordinate of the vector

y
T y;

Y coordinate of the vector

Meta