ddg.abc module
- class ddg.abc.LinearTransformable[source]
Bases:
ABCInterface for linearly transformable objects.
The transformations are projective transformations in homogeneous coordinates.
- ambient_dimension: int
- abstract transform(F)[source]
Return a linearly transformed copy.
The transformation is assumed to be a projective transformation in homogeneous coordinates.
- Parameters:
- Fnumpy.ndarray of shape (ambient_dimension + 1, ambient_dimension + 1)
- Returns:
- type(self)
- change_affine_picture(before, after=-1)[source]
Transform the object to a different affine view.
Dehomogenizing the object post-transform with affine component
afterwill produce the same affine picture as dehomogenizing the object pre-transform with affine componentbefore.The actual transformation that achieves this just permutes the homogeneous coordinates as follows: It deletes the entry at
beforeand inserts it again at positionafter.Here are two examples of how you might use this function:
You defined a projective object
Xwith a certain affine picture in mind and you followed our convention of using affine component -1. You now want to see what it would look like when dehomogenized using a different affine componenti. To do this, you would just doX_ = X.change_affine_picture(i)and then visualize the object normally.You don’t like our convention of dehomogenizing by the last component and want to define your object
Xwith the affine picture with respect to affine componentiin mind. To visualize your object as you imagine it, you would also doX_ = X.change_affine_picture(i).
- Parameters:
- beforeint
- afterint (default=-1)
- Returns:
- type(self)