Using a Frame as a Mapping

We should briefly point out that the FrameFrame we created above (§7.2) is also a MappingMapping (§5.1) and therefore inherits the properties and behaviour common to other Mappings.

One way to see this is to set the Frame's ReportReport attribute (inherited from the Mapping class) to a non-zero value and pass the Frame pointer to a coordinate transformation function, such as astTran2astTran2.


\begin{terminalv}
double xin[ 5 ] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 };
double yin...
..., ''Report=1'' );
astTran2( frame, 5, xin, yin, 1, xout, yout );
\end{terminalv}

The resulting output might then look like this:


\begin{terminalv}
(1, 2) --> (1, 2)
(2, 4) --> (2, 4)
(3, 6) --> (3, 6)
(4, 8) --> (4, 8)
(5, 10) --> (5, 10)
\end{terminalv}

This is not very exciting because a Frame implements an identity transformation just like a UnitMapUnitMap (§5.10). However, it illustrates that a Frame can be used as a Mapping and that its NinNin and NoutNout attributes are both equal to the number of Frame axes.

When we consider more specialised Frames (e.g. §13), we will see that using them as Mappings can be very useful indeed.