GACTM(3NCARG)

📦 version 6.6.2, in epel 9, fedora 43, fedora 44

🎀 GACTM 🎀 (the NCAR one, from the 3NCARG manual, bestie)


✨ NAME ✨

GACTM — short for Accumulate transformation matrix — is the glow-up function that builds you a GKS segment transformation matrix. It takes a matrix you already have and composes it with a shift vector, a rotation angle, and X + Y scale factors, and out pops a brand-new transformation matrix. The rotation and the scaling both happen around a fixed point that you get to define. Iconic behaviour honestly.


✨ SYNOPSIS ✨

CALL GACTM(MINP,X0,Y0,DX,DY,PHI,FX,FY,SW,MOUT)

✨ C-BINDING SYNOPSIS ✨

#include <ncarg/gks.h>

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

✨ DESCRIPTION ✨

okay so here's the whole cast, argument by argument, no skips:

  • MINP (Real, Input) — a 2x3 GKS transformation matrix. Your starting point, your blueprint, your before pic.
  • X0 (Real, Input) — the X coordinate of the fixed point that the scaling and rotation parts of the output transformation are gonna spin/scale around. This X lives in world coordinates or in normalized device coordinates, and which one depends on the SW argument (scroll down, it's explained).
  • Y0 (Real, Input) — the Y coordinate of that same fixed point for the scaling and rotation parts of the output transformation. Y is in world coordinates or normalized device coordinates, again depending on how SW is set (yes, same deal as X0).
  • DX (Real, Input) — the X component of a shift vector used for the scaling part of the output transformation. DX is in world coordinates or normalized device coordinates, depending on the setting of SW below. (Sensing a theme? 🦋)
  • DY (Real, Input) — the Y component of that shift vector, used for the scaling part of the output transformation. DY is in world coordinates or normalized device coordinates, depending on the setting of SW. You already knew that.
  • PHI (Real, Input) — the rotation angle, in radians, used for the rotation part of the output transformation. Radians, bestie. Not degrees. Do not come at me with degrees.
  • FX (Real, Input) — an X coordinate scale factor used in the scaling part of the output transformation.
  • FY (Real, Input) — a Y coordinate scale factor used in the scaling part of the output transformation.
  • SW (Integer, Input) — the coordinate switch, aka the vibes-check on whether X0, Y0, DX and DY (all described above, love them) are in world coordinates or normalized device coordinates. SW=0 means world coordinates and SW=1 means normalized device coordinates. That's it, that's the switch.
  • MOUT (Real, Output) — a 2x3 array holding the resulting GKS transformation matrix, in a form you can feed straight into other GKS functions like GSSGT. This matrix gets built by composing the scale, rotate and shift input (all that stuff above) with the original input matrix MINP. Chef's kiss. 👑

✨ USAGE ✨

  • If world coordinates are used, the shift vector and the fixed point get transformed by the current normalization transformation. Noted.
  • The order in which the transformations are applied is: input matrix, scale, rotate, and shift. Remember this order, it's the whole plot.
  • Elements MOUT(1,3) and MOUT(2,3) are in normalized device coordinates, and every other element of MOUT is unitless. Yes, a mixed bag. She contains multitudes.
  • GACTM can be used to construct more general transformation matrices than GEVTM can. The most common usage of GACTM is to change the order in which the operations of scale, rotate and shift are applied — because that order is fixed in GEVTM and GACTM lets you mess with it. The example below shows how to construct a transformation matrix that shifts first and then rotates. Main character energy fr fr.

✨ EXAMPLE ✨

Assuming the input matrix TIN is initially the identity, the following code:

      PI = 3.1415926
      CALL GACTM(TIN,.5,.5,.25,0.,0.,1.,1.,0,TOUT)
      DO 20 I=1,2
        DO 30 J=1,3
          TIN(I,J) = TOUT(I,J)
     30   CONTINUE
     20 CONTINUE
      CALL GACTM(TIN,.5,.5,0.,0.,45.*PI/180.,1.,1.,0,TOUT)

would produce a transformation matrix in TOUT that would shift by (.25,0.) first, and then rotate by 45 degrees. Obsessed with her.


✨ ACCESS ✨

To use GKS routines, load the NCAR GKS-0A library ncarg_gks. That's the one. 🫶


✨ SEE ALSO ✨

Online: gevtm, gclsg, gcrsg, gcsgwk, gdsg, gqopsg, gqsgus, gssgt., gaccum_tran_matrix

Hardcopy: "User's Guide for NCAR GKS-0A Graphics"


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


💀 obligatory note: this is the GACTM(3NCARG) page, straight outta the UNIX manual, dated March 1993. slay, and also please respect the License Agreement, bestie 💖 ✨ 🎀
📦 where this page comes from