simvx.core.math.transforms

Transform2D: a 2D position, rotation and scale that composes with its parent.

Module Contents

Classes

Transform2D

2D transform: position + rotation + scale with cached 3x3 matrix.

API

class simvx.core.math.transforms.Transform2D(position=(0, 0), rotation=0.0, scale=(1, 1))[source]

2D transform: position + rotation + scale with cached 3x3 matrix.

Initialization

property position: numpy.ndarray[source]
property rotation: float[source]
property scale: numpy.ndarray[source]
property matrix: numpy.ndarray[source]
translated(offset) simvx.core.math.transforms.Transform2D[source]

Return a new transform with position shifted by offset.

rotated(angle: float) simvx.core.math.transforms.Transform2D[source]

Return a new transform with additional rotation (radians).

scaled(factor) simvx.core.math.transforms.Transform2D[source]

Return a new transform with scale multiplied by factor.

transform_point(point) numpy.ndarray[source]

Transform a 2D point through this transform.

inverse() simvx.core.math.transforms.Transform2D[source]

Return the inverse transform.

__mul__(other)[source]
__eq__(other)[source]
__repr__()[source]