DOKK / manpages / debian 11 / libncarg-dev / geval_tran_matrix.3ncarg.en
GEVAL_TRAN_MATRIX(3NCARG) NCAR GRAPHICS GEVAL_TRAN_MATRIX(3NCARG)

geval_tran_matrix - Connstruct GKS segment by evaluating a transform matrix

geval_tran_matrix (Evaluate transformation matrix) - Constructs a GKS segment transformation matrix starting from a given point, a shift vector, a rotation angle, and X and Y scale factors.

#include <ncarg/gks.h>

void geval_tran_matrix(const Gpoint *point, const Gvec *shift, Gdouble angle, const Gvec *scale, Gcoord_switch coord_switch, Gtran_matrix tran_matrix);

(Gfloat, Input) - An 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.
(Gfloat, Input) - A 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.
(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.
(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.
(Input) - The rotation angle, in radians, to be used for the rotation part of the output transformation.
(Gfloat Input) - An X coordinate scale factor to be used in the scaling part of the output transformation.
(Gfloat Input) - A Y coordinate scale factor to be used in the scaling part of the output transformation.
(Input) - A coordinate switch to indicate whether the values for the arguments shift and scale (described above) are in world coordinates or normalized device coordinates. Possible values include:
World coordinates
Normalized device coordinates
(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.

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

The order of the transformation operations as built into the output matrix is: scale (relative to the fixed point); rotate (relative to the fixed point; 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.

The following code


pi = 3.1415926;
point.x = point.y = 0.5;
shift.delta_x = 0.25;
shift.delta_y = 0.;
scale.delta_x = 0.5;
scale.delta_y = 1.5;
geval_tran_matrix(&point,&shift,45.*pi/180.,&scale,GCOORD_WC,tm);

would produce a transformation matrix in tm that would: scale the X coordinates by .5, scale the Y coordinates by 1.5 (relative to the fixed point of (.5,.5) ); rotate by 45 degrees (relative to the fixed point (.5,.5) ); and shift by .25 in X and 0. in Y. The input values for the fixed point and shift vector are in world coordintes.

To use the GKS C-binding routines, load the ncarg_gks and ncarg_c libraries.

Online: gaccum_tran_matrix(3NCARG), gclose_seg(3NCARG), gcreate_seg(3NCARG), gcopy_seg_ws(3NCARG), gdel_seg(3NCARG), ginq_name_open_seg(3NCARG), ginq_set_seg_names(3NCARG), gset_seg_tran(3NCARG), gks(3NCARG), ncarg_gks_cbind(3NCARG)

Hardcopy: User's Guide for NCAR GKS-0A Graphics; NCAR Graphics Fundamentals, UNIX Version

Copyright (C) 1987-2009
University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.

March 1993 UNIX