Math::Vector2 struct

A vector of 2 float values (x, y).

Public static variables

static const Vector2 ZERO

Constructors, destructors, conversion operators

Vector2(float x, float y)
Vector2(const Point& other)

Public functions

auto Length() const -> float
Returns the length of the vector, computed as the square root of then sum of its components squared.
auto Normalized() const -> Vector2
Returns a normalized version of this vector. Being normalized means it has a length of 1.0.
auto Dot(const Vector2& other) const -> float
Computes the dot product between this vector and other.
auto operator+=(const Vector2&) -> Vector2&
auto operator+=(float) -> Vector2&
auto operator-=(const Vector2&) -> Vector2&
auto operator-=(float) -> Vector2&
auto operator*=(float) -> Vector2&
auto operator/=(float) -> Vector2&
auto operator==(const Vector2& b) const -> bool
auto operator!=(const Vector2& b) const -> bool

Public variables

float x
float y

Function documentation

float Math::Vector2::Dot(const Vector2& other) const

Computes the dot product between this vector and other.


The dot product is computed as a.x * b.x + a.y * b.y + a.z * b.z