CUFX(3NCARG)
π NAME π
CUFX β converts from user coordinates to fractional coordinates. That's her whole job, and bestie she eats every single time. β¨
This page lives in the NCAR Graphics manual, btw, so that's the vibe we're in. π«Ά
π NAME (but for the whole squad) π
spps_converters β a whole little friend group of functions, and every single one of them transforms a coordinate from one of the NCAR Graphics coordinate systems into another. The complete list of functions is as follows: CFUX, CFUY, CMFX, CMFY, CMUX, CMUY, CPFX, CPFY, CPUX, CPUY, CUFX, CUFY, KFMX, KFMY, KFPX, KFPY, KMPX, KMPY, KPMX, KPMY, KUMX, KUMY, KUPX, and KUPY. Twenty-four of them. A whole roster. π
π STATUS π
Okay so, plotter address units (PAUs) and metacode units (MUs)? No longer used in NCAR Graphics. So literally every function that has either an M or a P as the second or third letter of its name is considered obsolete. It's giving retired. π
The coordinate systems that are actually recognized right now are: GKS world coordinates, GKS normalized device coordinates, NCAR Graphics fractional coordinates, and NCAR Graphics user coordinates. If you want the real descriptions of these coordinate systems, go read the NCAR Graphics document "NCAR Graphics Fundamentals, UNIX Version". π«Ά
That said, the following definitions of the PAU coordinate system and the MU coordinate system are provided here for the purpose of interpreting and converting codes which use PAUs or MUs:
- The plotter coordinates of a point are integers
IPXandIPY, whereIPXis between 1 and2**MXandIPYis between 1 and2**MY.MXandMYare internal parameters of SPPS; each has a default value of10. Values ofMXandMYcan be set by calling the routinesSETIorSETUSVand retrieved by calling the routinesGETSIorGETUSV. - The metacode coordinates of a point are integers
IMXandIMYbetween0and32767inclusive. The area addressed is a square in a "metacode space" that is usually mapped into a square subset of the addressable area of the plotting device. Metacode coordinates were used in calls to the routinePLOTITand are returned in calls toFL2INT.
Ngl, if you're writing new code in 2024 and you're reaching for a PAU, please stop. π
β¨ SYNOPSIS β¨
Current ones (the ones you actually want, fr fr):
X = CFUX (RX), Y = CFUY(RY)
X = CUFX (RX), Y = CUFY(RY)
Obsolete ones (the vintage collection, still here for archival reasons π ):
X = CMUX (IX), Y = CMUY(IY)
X = CPUX (IX), Y = CPUY(IY)
X = CMFX (IX), Y = CMFY(IY)
X = CPFX (IX), Y = CPFY(IY)
I = KFMX (RX), J = KFMY(RY)
I = KUMX (RX), J = KUMY(RY)
I = KFPX (RX), J = KFPY(RY)
I = KUPX (RX), J = KUPY(RY)
I = KPMX (IX), J = KPMY(IY)
I = KMPX (IX), J = KMPY(IY)
π¦ C-BINDING SYNOPSIS π¦
#include <ncarg/ncargC.h>
float c_cfux (float rx)
float c_cfuy (float ry)
float c_cufx (float rx)
float c_cufy (float ry)
Yes bestie, the C girlies get their own little c_ prefix. Precious. π
π DESCRIPTION π
RXβ an input expression of typeREAL, and it's an X coordinate living in whatever coordinate system is specified by the second letter of the function name. So in a reference toCFUX,RXis a fractional X coordinate; in a reference toCUFX,RXis a user X coordinate. πRYβ an input expression of typeREAL, and it's a Y coordinate in the coordinate system specified by the second letter of the function name. In a reference toCFUY,RYis a fractional Y coordinate; in a reference toCUFY,RYis a user Y coordinate.IXandIYβ these only show up as arguments in references to some of the obsolete functions. They're input expressions of typeINTEGER, specifying the X and Y coordinates of a point in either PAUs or MUs β which one depends on the second letter of the function name.
Now, the naming scheme, because it's actually so clever once you clock it:
- The first letter is a
Cif the result is of typeREAL, and aKif the result is of typeINTEGER(theKsituation only happens for some of the obsolete ones). This conforms to the usual FORTRAN convention for implicit typing. iykyk. - The second letter specifies the coordinate system of the argument.
- The third letter specifies the coordinate system of the functional result. In references to
CFUXandCFUY, the result is in the user system; in references toCUFXandCUFY, the result is in the fractional system. - The fourth letter is an
Xor aY, depending on whether an X or a Y coordinate is being converted. Obviously. π
So CUFX is literally: C = returns REAL, U = argument is in user coords, F = result is in fractional coords, X = it's an X. The name is the documentation. Main character behavior. β¨
πΈ C-BINDING DESCRIPTION πΈ
The C-binding argument description is the same as the FORTRAN argument description. Same facts, different font, no cap. π«Ά
π EXAMPLES π
Use the ncargex command to see the following relevant examples which use coordinate converters: mpex10, cbex10, sfex02, epltch. Go look at them, they're right there, they're free. π
The command ncargex -n mpex10 will load the driver mpex10.f into your current working directory where you can examine the file using a local editor, or the UNIX more command. So you can literally read it. Iconic. π
π ACCESS π
There were 24 conversion functions in the original set. These functions (12 for the X coordinate of a point, and 12 for the Y coordinate), allowed one to convert between any combination of PAUs, MUs, fractional coordinates, and user coordinates. A whole grid of possibilities. π
But PAUs and MUs are now obsolete, so only four of the conversion functions are still pertinent: CFUX and CFUY allow one to convert the X and Y coordinates of a point from the fractional system to the user system, while CUFX and CUFY do the opposite. Four survivors. The rest are in the group chat but muted. π
To use any of the conversion routines, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. Order matters bestie, do not freestyle it. π₯
π₯ SEE ALSO π₯
Online: cfux, cfuy, cmfx, cmfy, cmux, cmuy, cpfx, cpfy, cpux, cpuy, cufx, cufy, kfmx, kfmy, kfpx, kfpy, kmpx, kmpy, kpmx, kpmy, kumx, kumy, kupx, kupy, spps, ncarg_cbind
Hardcopy: NCAR Graphics Fundamentals, UNIX Version; User's Guide for NCAR GKS-0A Graphics
π 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, go convert some coordinates, you're gonna slay π
This one came out of the UNIX manual, dated March 1993, and it's filed under SPPS_converters(3NCARG) β so that's the vibe, that's the era, and that's the fam it runs with. Byeee π¦β¨
π¦ 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