GEVAL_TRAN_MATRIX(3NCARG)
β¨ geval_tran_matrix β it's giving transformation matrix π
okay bestie so this is a page from the NCAR GRAPHICS manual set (yes, the UNIX one, the classic) and it's about geval_tran_matrix, which literally just means "evaluate transformation matrix". No cap.
So what does it do? It constructs a GKS segment transformation matrix starting from a given point, a shift vector, a rotation angle, and X and Y scale factors. That's it. That's the whole vibe. π
πΈ SYNOPSIS πΈ
#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);
yes she takes six arguments. we're gonna go through every single one, no skipping, periodt. π
π DESCRIPTION π
point.xβ (Gfloat, Input) β An X coordinate value for a fixed point to be used for the scaling and rotation parts of the output transformation. Now here's the tea:point.xis either in world coordinates or normalized device coordinates, depending on the setting of the argumentcoord_switchdescribed below. Pick a lane, bestie. π¦point.yβ (Gfloat, Input) β A Y coordinate value for a fixed point to be used for the scaling and rotation parts of the output transformation. Same deal as its sibling:point.yis either in world coordinates or normalized device coordinates depending on the setting of the argumentcoord_switchdescribed below. πshift.delta_xβ (Gfloat, Input) β The X component of a shift vector to be used for the scaling part of the output transformation. And yep,shift.delta_xis either in world coordinates or normalized device coordinates depending on the setting of the argumentcoord_switchdescribed below. (do you see a pattern? we love consistency.) β¨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_yis either in world coordinates or normalized device coordinates depending on the setting of the argumentcoord_switchdescribed below. π«Άangleβ (Input) β The rotation angle, in radians, to be used for the rotation part of the output transformation. radians!! not degrees!! do not come crying to me when your shape is sideways. πscale.delta_xβ (Gfloat Input) β An X coordinate scale factor to be used in the scaling part of the output transformation.scale.delta_yβ (Gfloat Input) β A 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 argumentsshiftandscale(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 asgset_seg_tran. slay, she's reusable. π
π§ USAGE π§
If world coordinates are used, the shift vector and the fixed point are transformed by the current normalization transformation. (iykyk)
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.
Also important, lowkey: elementstran_matrix[0][2]andtran_matrix[1][2]are in normalized device coordinates and the other elements oftran_matrixare unitless. Don't ask me why, that's just the lore. π
π EXAMPLE π
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.
(yes, the original says "coordintes". we keep the typo, we respect the ancestors. π)
π ACCESS π
To use the GKS C-binding routines, load the ncarg_gks and ncarg_c libraries.
π SEE ALSO π
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 π
Copyright (C) 1987-2009 University Corporation for Atmospheric Research The use of this Software is governed by a License Agreement.
okay that's the whole page, bestie, you're officially educated π§ β¨ this was the GEVAL_TRAN_MATRIX(3NCARG) page from the NCAR Graphics manual, UNIX flavour, dated March 1993 β and honestly? she still ate. go forth and rotate your segments, main character. πΈπ¦π
π¦ where this page comes from
- epel 9: ncl-devel 6.6.2-59.el9 Β· LicenseRef-Callaway-BSD
- fedora 43: ncl-devel 6.6.2-58.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: ncl-devel 6.6.2-62.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms