KFPX(3NCARG)

πŸ“¦ version 6.6.2, in epel 9, fedora 43, fedora 44

πŸ’– NAME πŸ’–

okay so first things first, this page is from the 3NCARG manual (NCAR Graphics, bestie) and it's covering two things at once:

  • KFPX β€” converts from fractional coordinates to plotter address unit coordinates.
  • spps_converters β€” a whole set of functions, each of which transforms a coordinate from one of the NCAR Graphics coordinate systems to another. the full roster is literally: 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. yes that's 24 of them, we'll get there πŸ’…

⚠️ STATUS ⚠️

Plotter Address Units (PAUs) and Metacode Units (MUs) are no longer used in NCAR Graphics. so like… every single function that has an M or a P as its second or third letter? considered obsolete. rip to them but they're different 🫢

the coordinate systems that are actually still recognized rn are:

  • GKS world coordinates
  • GKS normalized device coordinates
  • NCAR Graphics fractional coordinates
  • NCAR Graphics user coordinates

if you want the full lore on these, go read the NCAR Graphics document "NCAR Graphics Fundamentals, UNIX Version" 🌸

now, the following definitions of the PAU coordinate system and the MU coordinate system are provided purely so you can interpret and convert codes that still use PAUs or MUs:

the plotter coordinates of a point are integers IPX and IPY, where IPX is between 1 and 2**MX and IPY is between 1 and 2**MY. MX and MY are internal parameters of SPPS, and each one has a default value of 10. you can set MX and MY by calling the routines SETI or SETUSV, and you can get them back by calling the routines GETSI or GETUSV ✨

the metacode coordinates of a point are integers IMX and IMY between 0 and 32767 inclusive. 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 routine PLOTIT and are returned in calls to FL2INT. no cap πŸ’€


✨ SYNOPSIS ✨

Current:

X = CFUX (RX),  Y = CFUY(RY)
X = CUFX (RX),  Y = CUFY(RY)

Obsolete:

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)

πŸ’œ DESCRIPTION πŸ’œ

  • RX β€” an input expression of type REAL, and it's an X coordinate in whatever coordinate system is specified by the second letter of the function name. so in a reference to CFUX, RX is a fractional X coordinate; in a reference to CUFX, RX is a user X coordinate. periodt.
  • RY β€” an input expression of type REAL, and it's a Y coordinate in whatever coordinate system is specified by the second letter of the function name. in a reference to CFUY, RY is a fractional Y coordinate; in a reference to CUFY, RY is a user Y coordinate.
  • IX and IY β€” these only show up as arguments in references to some of the obsolete functions. they represent input expressions of type INTEGER, 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, iykyk).

now let's decode the naming scheme because honestly it's giving secret code πŸ”

  • the first letter of the function name is a C if the result is of type REAL, and a K if the result is of type INTEGER (and the K situation only happens for some of the obsolete ones). this conforms to the usual FORTRAN convention for implicit typing. iconic.
  • the second letter of the function name specifies the coordinate system of the argument.
  • the third letter of the function name specifies the coordinate system of the functional result. so in references to CFUX and CFUY, the result is in the user system; in references to CUFX and CUFY, the result is in the fractional system.
  • the fourth letter of the function name is an X or a Y, depending on whether an X or a Y coordinate is being converted. simple as that πŸ’…

🌈 C-BINDING DESCRIPTION 🌈

the C-binding argument description is the same as the FORTRAN argument description. that's it, that's the whole section, slay πŸ’–


πŸ¦‹ EXAMPLES πŸ¦‹

use the ncargex command to see the following relevant examples which use coordinate converters: mpex10, cbex10, sfex02, epltch.

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. go look at it bestie, it's right there 🫢


πŸ‘‘ 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. but PAUs and MUs are now obsolete, so only four of the conversion functions are still pertinent:

  • CFUX and CFUY let you convert the X and Y coordinates of a point from the fractional system to the user system
  • CUFX and CUFY do the exact opposite

to use any of the conversion routines, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c β€” preferably in that order 🌟


⭐ SEE ALSO ⭐

Online: cfux, cfuy, cmfx, cmfy, cmux, cmuy, cpfx, cpyf... okay no, it's 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 (C) 1987-2009 University Corporation for Atmospheric Research

The use of this Software is governed by a License Agreement.


and that's the whole page bestie πŸ’– this one came from the UNIX manual, dated March 1993, and it's filed under SPPS_converters(3NCARG) β€” so if you ever need to cite it, that's the glow-up signature. mwah, go convert some coordinates 🌸✨

πŸ“¦ where this page comes from