I have a requirement to perform a series of GeometricTransformation[]
s using the AfineTransform[]
function. I use these to set up something similar to a kinematic chain in something similar to a mechanism.
Four geometric objects are stored in a list, say
fList={f1, f2, f3, f4}
and four affine transforms are stored in their own list, say
tList={t1, t2, t3, t4}
Right now I am performing the geometric transformations as follows
f1New=Fold[GeometricTransformation[#1,#2]&, fList[[1]], tList[[1;;1;;-1]]];
f2New=Fold[GeometricTransformation[#1,#2]&, fList[[2]], tList[[2;;1;;-1]]];
f3New=Fold[GeometricTransformation[#1,#2]&, fList[[3]], tList[[3;;1;;-1]]];
f4New=Fold[GeometricTransformation[#1,#2]&, fList[[4]], tList[[4;;1;;-1]]];
However, I would like to combine the four lines into a single line that generates a list of four new transforms and write a function to apply the transforms for lists of N graphics objects and N affine transforms.
So far I have tried to use Nest[]
but that has not worked. I'm sure there is a subtle way to handle this but it eludes me. I would appreciate a hint.
Also, I am trying to stay away from using For[]
or Do[]
constructs because I am fascinated by Mathematica outstanding proficiency at handling lists.
Thank you and all the best!
B