GACTM(3NCARG)

✨ GACTM ✨ β€” the NCAR GRAPHICS glow-up (manual page GACTM(3NCARG), bestie πŸ’–)

okay so. this page lives in the NCAR GRAPHICS manual, and it's about gactm, aka Accumulate (GKS) transformation matrix. yes the title is in all caps, it's giving vintage, we love her.


🌸 NAME 🌸

gactm β€” accumulate (GKS) transformation matrix. that's it, that's the whole name, short and iconic πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so GACTM (Accumulate transformation matrix, for the people who like the long version) constructs a GKS segment transformation matrix. here's the vibe: you start with a matrix you already have, and then you compose it with a shift vector, a rotation angle, and X and Y scale factors, and boom πŸ’₯ β€” a brand new transformation matrix.

the rotation and the scaling both happen with respect to a user-defined fixed point. you pick the point, you're the main character, you choose.


πŸŽ€ 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 (the arguments, aka the whole cast) πŸ’…

  • MINP (Real, Input) β€” a 2x3 GKS transformation matrix. this is your starting point, your base layer, your canvas πŸ’œ
  • X0 (Real, Input) β€” an X coordinate value for the fixed point used in the scaling and rotation parts of the output transformation. X is either in world coordinates or in normalized device coordinates, depending on how you set the argument SW (she's described below, keep reading 🫢).
  • Y0 (Real, Input) β€” a Y coordinate value for the fixed point used in the scaling and rotation parts of the output transformation. Y is either in world coordinates or normalized device coordinates depending on the setting of SW, same deal as above.
  • DX (Real, Input) β€” the X component of a shift vector used for the scaling part of the output transformation. DX is either in world coordinates or normalized device coordinates depending on the setting of SW.
  • DY (Real, Input) β€” the Y component of a shift vector used for the scaling part of the output transformation. DY is either in world coordinates or normalized device coordinates depending on the setting of SW.
  • 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 "which universe are we in" flag. it says whether the values for X0, Y0, DX and DY (all described above, hi again) are in world coordinates or normalized device coordinates.
    • SW=0 β†’ world coordinates 🌍
    • SW=1 β†’ normalized device coordinates πŸ“
  • MOUT (Real, Output) β€” a 2x3 array holding the GKS transformation matrix, in a form that can be fed straight into other GKS functions like GSSGT. this matrix is constructed by composing the scale, rotate and shift input (all described above, they're the moment) with the original input matrix MINP. πŸ’–

πŸ”₯ USAGE πŸ”₯

if world coordinates are in play, the shift vector and the fixed point get transformed by the current normalization transformation. noted. that's just how it goes.

the order in which the transformations are applied is: input matrix, scale, rotate, and shift. in that order. no cap. don't shuffle them unless you know what you're doing (and if you do, see below, because that's literally the point of this routine).

elements MOUT(1,3) and MOUT(2,3) are in normalized device coordinates, and the other elements of MOUT are unitless. they just vibe. they have no units. 🧚

GACTM can construct more general transformation matrices than GEVTM. 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. the example below shows how to build a transformation matrix that shifts first and then rotates. iconic behaviour, honestly.


🌟 EXAMPLE 🌟

assuming the input matrix TIN is initially the identity, this 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 shifts by (.25,0.) first, and then rotates by 45 degrees. slay 🌈


πŸ‘‘ ACCESS πŸ‘‘

to use GKS routines, load the NCAR GKS-0A library ncarg_gks. that's the one. that's your girl.


πŸ’€ 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.


and that's the page, bestie ✨ this was GACTM(3NCARG) from the UNIX manual, dated March 1993, and yes she's still serving. go compose those matrices, you've got this πŸ’–πŸŽ€πŸ¦‹