Combining Mappings in Series

Consider a simple example based on two 2-dimensional coordinate systems. Suppose that to convert from one to the other we must swap the coordinate order and multiply both coordinates by 5, so that the coordinates ($x_1,x_2$) transform into ($5x_2,5x_1$). This can be done in two stages:

  1. Apply a PermMapPermMap (§5.11) to swap the coordinate order.

  2. Apply a ZoomMapZoomMap (§4.8) to multiply both coordinate values by the constant 5.

The PermMap and ZoomMap are then said to operate in series, because they are applied sequentially (c.f. Figure 2). We can create a CmpMapCmpMap that applies these Mappings in series as follows:


\begin{terminalv}
...

Here, the third argument (1) of the constructor function astCmpMapastCmpMap indicates “in series”.

When used to transform coordinates in the forward direction, the resulting CmpMap will apply the first component MappingMapping (the PermMap) and then the second one (the ZoomMap). When transforming in the inverse direction, it will apply the second one (in the inverse direction) and then the first one (also in the inverse direction). In general, although not in this particular example, the order in which the two component Mappings are supplied is significant. Clearly, also, the NoutNout attribute (number of output coordinates) for the first Mapping must equal the NinNin attribute (number of input coordinates) for the second one.