Christoph Maier
04/19/2024, 1:05 AMThe transform line gives the geometric transform from coordinates of the child filename into coordinates of the cell being read. The six integers a, b, c, d, e, and f are part of the following transformation matrix, which is used to postmultiply all coordinates in the child filename whenever their coordinates in the parent are required:
a
d
0
b
e
0
c
f
1
defined in a way that the coordinate computation becomes understandable?Mitch Bailey
04/19/2024, 2:33 AMa b c
d e f
0 0 1
This is the product of the translation matrix (Tx is the x offset and Ty is the y offset)
1 0 Tx
0 1 Ty
0 0 1
the rotation matrix (θ is 0, 90, 180, or 270)
cosθ sinθ 0
-sinθ cosθ 0
0 0 1
and the reflection matrix when mirrored about the x-axis
1 0 0
0 -1 0
0 0 1
or the y-axis
-1 0 0
0 1 0
0 0 1
So if we let Mx be 1 normally and -1 when mirrored about the x-axis,
let My be 1 normally and -1 when mirrored about the y-axis, we can use this reflection matrix
My 0 0
0 Mx 0
0 0 1
and assume the transformations are applied in the translation-rotation-reflection order (the order is relevant)
and ignore any scaling (which would be another matrix)
The combined matrix variables would be
a = cosθ・My
b = sinθ・Mx
c = Tx
d = -sinθ・My
e = cosθ・Mx
f = Ty
This matrix is cross multiplied by a vertical matrix of the coordinates
x
y
1
With the transformed coordinate being
x' = cosθ・My・x + sinθ・Mx・y + Tx
y' = -sinθ・My・x + cosθ・Mx・y + Ty
and the third value (always 1) is ignored.Christoph Maier
04/19/2024, 11:02 AM