ncl_gaccum_tran_matrix man page

gaccum_tran_matrix (Accumulate transformation matrix) — Constructs a GKS segment transformation matrix by starting with an existing matrix and composing it with a shift vector, a rotation angle, and X and Y scale factors to create a new transformation matrix. The rotation and scaling are done with respect to a user-defined fixed point.

(Gfloat, Input) - X coordinate value for a fixed point to be used for the scaling and rotation parts of the output transformation. point.x is either in world coordinates or normalized device coordinates depending on the setting of the argument coord_switch described below.

point.y

(Gfloat, Input) - Y coordinate value for a fixed point to be used for the scaling and rotation parts of the output transformation. point.y is either in world coordinates or normalized device coordinates depending on the setting of the argument coord_switch described below.

shift.delta_x

(Gfloat, Input) - The X component of a shift vector to be used for the scaling part of the output transformation. shift.delta_x is either in world coordinates or normalized device coordinates depending on the setting of the argument coord_switch described below.

shift.delta_y

(Gfloat, Input) - The Y component of a shift vector to be used for the scaling part of the output transformation. shift.delta_y is either in world coordinates or normalized device coordinates depending on the setting of the argument coord_switch described below.

angle

(Input) - The rotation angle, in radians, to be used for the rotation part of the output transformation.

scale.delta_x

(Gfloat, Input) - X coordinate scale factor to be used in the scaling part of the output transformation.

scale.delta_y

(Gfloat, Input) - Y coordinate scale factor to be used in the scaling part of the output transformation.

coord_switch

(Input) - A coordinate switch to indicate whether the values for the arguments point and shift (described above) are in world coordinates or normalized device coordinates. Possible values include:

GCOORD_WC

World coordinates

GCOORD_NDC

Normalized device coordinates

tran_matrix

(Gfloat, Output) - A 2x3 array that contains the GKS transformation matrix in a form that can be used as input to other GKS functions such as gset_seg_tran. This matrix is constructed by composing the scale, rotate, and shift input, described above, with the original input matrix t_matrix.

If world coordinates are used, the shift vector and the fixed point are transformed by the current normalization transformation.

The order in which the transformations are applied is: input matrix, scale, rotate, and shift.

Elements tran_matrix[0][2] and tran_matrix[1][2] are in normalized device coordinates and the other elements of tran_matrix are unitless.

gaccum_tran_matrix can be used to construct more general transformation matrices than geval_tran_matrix. The most common usage of gaccum_tran_matrix is to change the order in which the operations of scale, rotate, and shift are applied (which is fixed in geval_tran_matrix). The example below shows how to construct a transformation matrix that shifts first and then rotates.