vector2aux

Provides functions for creating and manipulating 2D vectors.

Module Contents

Classes

index

Index class for the Vector2.

unit

Unit class for the Vector2.

Functions

create(→ numpy.ndarray)

Create a Vector2 object.

create_unit_length_x(→ numpy.ndarray)

Create a x unit Vector2.

create_unit_length_y(→ numpy.ndarray)

Create a y unit Vector2.

create_from_matrix33_translation(→ numpy.ndarray)

Create a Vector2 from a 3x3 Matrix.

create(x: float = 0.0, y: float = 0.0, dtype: Any = None) numpy.ndarray

Create a Vector2 object.

# noqa: DAR401

Parameters:
  • x – x size.

  • y – y size.

  • dtype – data-type.

Returns:

The Vector.

create_unit_length_x(dtype: Any = None) numpy.ndarray

Create a x unit Vector2.

Parameters:

dtype – data-type.

Returns:

The Vector.

create_unit_length_y(dtype: Any = None) numpy.ndarray

Create a y unit Vector2.

Parameters:

dtype – data-type.

Returns:

The Vector.

create_from_matrix33_translation(mat: Any, dtype: Any = None) numpy.ndarray

Create a Vector2 from a 3x3 Matrix.

Parameters:
  • mat – The 3x3 Matrix.

  • dtype – The data-type.

Returns:

The Vector2.

class index

Index class for the Vector2.

x = 0
y = 1
class unit

Unit class for the Vector2.

x
y