# Coordinate Transformation Operators

This clause defines the operators that manipulate Transformations, and which
affect the CurrentTransformation Graphics State Variable.
The type Transformation and the coefficients
associated with Transformations are defined in
.

The definition of the Transformation operators requires the following definitions.
If T_{1} and
T_{2}
are two Transformations,
the mapping which consists of applying the mapping represented by
T_{1}
to the result of the mapping represented by
T_{2} is
also of the form specified in . The Transformation which
represents this mapping is referred to as the concatenation of
T_{1}
with T_{2} (denoted
T_{1} ×
T_{2}).
If T_{1} and
T_{2}
are two Transformations whose associated matrices are respectively

M_{1}=
a_{1}
c_{1}
e_{1}
b_{1}
d_{1}
f_{1}
001

M_{2}=
a_{2}
c_{2}
e_{2}
b_{2}
d_{2}
f_{2}
001

then T_{1} ×
T_{2} is the
Transformation whose associated matrix is the (usual matrix) product
M_{1}×
M_{2}, which is defined by

M_{1} × M_{2}=
(a_{1}× a_{2}+ b_{1}×
c_{2})
(c_{1}× a_{2}+ d_{1}×
c_{2})
(e_{1}× a_{2}+f_{1}×
c_{2}+ e_{2})
(a_{1}× b_{2}+ b_{1}×
d_{2})
(c_{1}× b_{2}+ d_{1}×
d_{2})
(e_{1}× b_{2}+f_{1}×
d_{2}+ f_{2})
001

The specification of these operators and their semantics includes the
specification
of conditions which may cause content exceptions to be raised as a result of
interpretation of the operators. Content exceptions and exception handling
are defined in . In addition to these operator-specific exceptions,
there are generic exceptions which may be raised during the interpretation of
almost any operator. These generic exceptions and their semantics are described
in .

## ScaleT

The ScaleT operator takes two operands

<s_{2}: Number>
<s_{1}: Number>
and returns a single result
<T: Transformation>
where T is the Transformation whose matrix is:
s_{1}
00
0s_{1}0
001

When applied, the effect of this Transformation is to scale
the User Coordinate System by a factor of s_{1}
in the x-axis and s_{2} in
the y-axis.
## Scale

The Scale operator takes two operands

<s_{2}: Number>
<s_{1}: Number>
and returns no results. The effect of the Scale operator
is the same as
{s1 s2 ScaleT Concat}
## TranslateT

The TranslateT operator takes two operands

<y: Number>
<x: Number>
and returns a single result
<T: Transformation>
where T
is the Transformation whose matrix is:
10x
01y
001
When applied, the effect of this Transformation is to translate
the coordinate system so that the origin is the point whose coordinates are
(x,y) in the current User Coordinate
System.
## Translate

The Translate operator takes two operands

<y: Number>
<x: Number>
and returns no results. The effect of the Translate
operator is the same as
{x y TranslateT Concat}
## RotateT

The RotateT operator takes one operand

<a: Number>
where a is in degrees and returns a single result
<T: Transformation>
where T is the Transformation whose matrix is:
cos a-sin a0
sin a cos a 0
0 01
When applied, the effect of this Transformation is to rotate
the User Coordinate System a degrees in a counter-clockwise
direction about the current origin.
## Rotate

The Rotate operator takes one operand

<a: Number>
where a is in degrees and returns no results. The effect of the
Rotate operator is the same as
{a RotateT Concat}
## ConcatT

The ConcatT operator takes two operands

<T_{2}: Transformation>
<T_{1}: Transformation>
and returns a single result
<T_{3}: Transformation>
where T_{3} =
T_{1}
× T_{2}.
## Concat

The Concat operator takes a single operand

<T: Transformation>
and returns no results. If T_{0}
is the Transformation (see ) that represents the
CurrentTransformation at the time at which Concat
is executed, then Concat changes its value to T
×T_{0}.
## SetTrans

The SetTrans operator takes a single operand

<T: Transformation>
and returns no results. The effect is to set the
CurrentTransformation
Graphics State Variable to T
×T_{i}
where T_{i} is the
Initial CurrentTransformation component of the Virtual
Machine (see ).
## GetTrans

The GetTrans operator takes no operands and returns
a single result

<T: Transformation>
where T
is the Transformation for which {T
SetTrans} would set the CurrentTransformation
Graphics State Variable to its current value.