Vector2

Vector2 consists two floats, x and y. Similar to Matrices, Vectors also have two methods of accessing their variables.

Namely, you can access them directly, or using the [] operator, similar to an array.

The following example uses both methods:

float Vector2::Dot(const Vector2& other) const {
	return asArray[0] * other.x + asArray[1] * other.y;
}

Vector2 also features the following utility functions:

The following utility functions return *new* Vector2 objects: