vector2

A representation of a 2d Vector.

Module Contents

Classes

Vector2

Represents a 2-dimensional Vector. The Vector2 class is based on the pyrr implementation of vectors.

class Vector2(shape, dtype=float, buffer=None, offset=0, strides=None, order=None)

Bases: pyrr.objects.base.BaseVector

Inheritance diagram of simulation.scene.vector2.vector2.Vector2

Represents a 2-dimensional Vector. The Vector2 class is based on the pyrr implementation of vectors.

property inverse: Vector2
Returns:

the inversed Vector2.

x
y
xy
__add__(other: Any) Vector2

Add to the existing Vector2.

Parameters:

other – The other Vector2.

Returns:

The added Vector2.

__sub__(other: Any) Vector2

Subtract from the existing Vector2.

Parameters:

other – The other Vector2.

Returns:

The subtracted Vector2.

__mul__(other: Any) Vector2

Multiply the existing Vector2.

Parameters:

other – The other Vector2.

Returns:

the multiplied Vector2.

__xor__(other: Any) Any

Calculate the cross-product.

Parameters:

other – The other Vector2.

Returns:

The cross-product.

__or__(other: Any) Any

Calculate the dot-product.

Parameters:

other – The other Vector2.

Returns:

The dot-product.

__ne__(other: Any) bool

Not equal to the existing Vector2.

Parameters:

other – The other Vector2.

Returns:

whether they are unequal.

__eq__(other: Any) bool

Equal to the existing Vector2.

Parameters:

other – The other Vector2.

Returns:

whether they are equal.