##
Using a FrameSet as a Mapping

The FrameSetFrameSet class inherits properties and behaviour from the FrameFrame class (§7) and, in turn, from the MappingMapping class (§5). Its behaviour when used as a Mapping is particularly important.

Consider, for instance, passing a FrameSet pointer to a coordinate transformation function such as astTran2astTran2:

207#207

The coordinate transformation applied by this FrameSet would be the one which converts between its base and current Frames. Using the FrameSet in Figure 14, for example, the coordinates would be multiplied by a factor of 5. If we instead requested the FrameSet's inverse transformation, we would be transforming from its current Frame to its base Frame, so our example FrameSet would then multiply by a factor of 0.2.

Whenever the choice of base and current Frames changes, the transformations which a FrameSet performs when used as a Mapping also change to reflect this. The NinNin and NoutNout attributes may also change in consequence, because they are determined by the numbers of axes in the FrameSet's base and current Frames respectively. These numbers need not necessarily be equal, of course.

Like any Mapping, a FrameSet may also be inverted by changing the boolean sense of its InvertInvert attribute, e.g. using astInvertastInvert (§5.6). If this is happens, the values of the FrameSet's BaseBase and CurrentCurrent attributes are interchanged, along with its Nin and Nout attributes, so that its base and current Frames swap places. When used as a Mapping, the FrameSet will therefore perform the inverse transformation to that which it performed previously.

To summarise, a FrameSet may be used exactly like any other Mapping which inter-relates the coordinate systems described by its base and current Frames.