Vector2f

class vecked.Vector2f(x: TNumeric, y: TNumeric)[source]

A two-dimensional floating-point vector.

add_vector2(length: Vector2[float | int]) Vector2f[source]

Returns the addition of this vector to another.

clamp(minimum: float | None = None, maximum: float | None = None) Vector2f[source]

Returns a copy of this vector with each length clamped to minimum and maximum.

inverse_lerp(a: Vector2f, b: Vector2f) Vector2f[source]

Gets the normalised distance of this vector from a in the direction of b.

lerp(a: Vector2f, b: Vector2f) Vector2f[source]

Gets the value this normalised vector’s distance between a towards b.

multiply_length(length: float | int) Vector2f[source]

Returns the multiplication of this vector by a length in both dimensions.

multiply_vector2(length: Vector2[float | int]) Vector2f[source]

Returns the multiplication of this vector by another.

reflect_vertically(y: float = 0) Vector2f[source]

Reflects this vector across a horizontal mirror.

subtract_vector2(length: Vector2[float | int]) Vector2f[source]

Returns the subtraction of a two-dimensional vector from this.