hanjinliu / coords-array

N-Dimensional array implemented with slicing, transformation and interpolation in a coordinate-based manner.
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Connect Affine transformation with coordinates #2

Open hanjinliu opened 2 years ago

hanjinliu commented 2 years ago

Since LinearTransformedAxis retains all the components, coordinates should be transformed in a conjugative manner.

import coords_array as cr
from coords_array.transform import rotate  # not implemented yet!

arr = cr.zeros((100, 100), coords=["y", "x"])
arr_rot = rotate(arr, 90)
arr_rot.coords[0]  # should be "-1x+0y"
arr_rot.coords[1]  # should be "0x+1y"