Description
I started implementing AffineTransformation which is pretty easy, except for one tricky design decision: should composition of specific AffineTransformation types eagerly compose into a composite AffineTransformation, or should they remain apart?
For most uses, I'm guessing eager composition is better since it'll be more efficient if you're just applying the transformation to many points. However, it's not a good idea if you want to optimize the parameters of one part of the transformation chain.
My current thought is that composition should be eager by default, but we could add a wrapper type for transformations to mark them as lazy. Come to think of it, maybe the wrapper type should be the signal that we're going to want derivative information in transform_deriv_params()
? Currently there's no way to indicate which parts of a transformation chain should be differentiated...
Usage musings...
V = Translation(1.0, 2.0, 3.0)
R = ParameterizedTransform(θ->RotationXY(θ))
# R1 = apply_params(R, 1.0) # RotationXY(1.0) ?
T = R ∘ V
dTdθ = transform_deriv_params(trans, 1.0) # Evaluates derivative of T at θ = 1.0 ?