SRFACE(3NCARG)

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

✨ SRFACE β€” the NCAR Graphics glow-up ✨

okay bestie, listen. SRFACE is a Fortran routine from NCAR Graphics and it draws you a perspective picture of a function of two variables β€” and the hidden lines are removed like a bad ex from your camera roll. 🫢 The function gets approximated by a two-dimensional array of heights, so basically it's a lil 3D landscape made of numbers. πŸ’…


🌸 NAME 🌸

SRFACE β€” draws a perspective picture of a function of two variables with hidden lines removed. The function is approximated by a two-dimensional array of heights. no cap. πŸ”₯


πŸ’– SYNOPSIS πŸ’–

CALL SRFACE (X,Y,Z,M,MX,NX,NY,S,STEREO)

πŸ¦‹ C-BINDING SYNOPSIS πŸ¦‹

#include <ncarg/ncargC.h>

void c_srface (float *x, float *y, float *z, int *m,
int mx, int nx, int ny, float s[6], float stereo)

✨ DESCRIPTION ✨

here's the whole cast of characters, bestie, one by one πŸ‘‘

  • X β€” a linear array, NX long, holding the X coordinates of the points in the surface approximation. peep the USAGE section below, iykyk.
  • Y β€” the linear array, NY long, holding the Y coordinates of the points in the surface approximation. again, USAGE is right there.
  • Z β€” an array that's MX by NY, containing the surface to be drawn in NX by NY cells. Z(I,J) = F(X(I),Y(J)). yes literally, that's the formula. USAGE, go look.
  • M β€” scratch array. at least 2*NX*NY words long. it's just there to hold stuff, don't ask questions πŸ’€
  • MX β€” first dimension of Z.
  • NX β€” number of data values in the X direction (the first subscript direction) in Z to be plotted. when you're plotting an entire array, MX=NX. periodt.
  • NY β€” number of data values in the Y direction (the second subscript direction) to be plotted.
  • S β€” S defines the line of sight. the viewer's eye is at (S(1), S(2), S(3)) and the point being looked at is at (S(4), S(5), S(6)). The eye should be outside the block with opposite corners (X(1), Y(1), ZMIN) and (X(NX), Y(NY), ZMAX), and the point looked at should be inside it. for a nice perspective effect, the distance between the eye and the point looked at should be 5 to 10 times the size of the block. main character framing, honestly πŸ“Έ
  • STEREO β€” flag saying whether stereo pairs get drawn. 0.0 means no stereo pair (one picture). non-zero means put out two pictures. the value of STEREO is the relative angle between the eyes. a value of 1.0 produces standard separation. negative STEREO reverses the left and right figures. πŸ‘€βœ¨

πŸŽ€ C-BINDING DESCRIPTION πŸŽ€

the C-binding argument descriptions are the same as the FORTRAN ones, with these lil exceptions, bestie:

  • z β€” an array ny by mx.
  • mx β€” second dimension of z.
  • nx β€” number of data values in the y direction (the second subscript direction) in z to be plotted. when plotting an entire array, mx=nx.
  • ny β€” number of data values in the x direction (the first subscript direction) to be plotted.
⚠️ yeah the x and y directions genuinely swap around between the FORTRAN and C versions. that's not a typo, that's just the vibe. double check before you ship it fr fr 😭

🌈 USAGE 🌈

  • the range of Z compared with the range of X and Y determines the shape of the picture. they're assumed to be in the same units and not wildly different in magnitude. S is assumed to be in the same units as X, Y, and Z.
  • picture size can be made relative to distance.
  • TRN32S can be used to translate from 3 space to 2 space. πŸͺ„
  • data with extreme discontinuities may cause visibility errors. if this problem occurs, use a distant eye position away from the +Z axis. that's the fix, that's the whole fix.
  • the default line color is set to color index 1. if the user wishes to change the line color, he can do so by defining color index 1 before calling SRFACE, or by putting the common block SRFINT in his calling program and defining and using color index ISRFMJ (defaulted to 1 in BLOCKDATA). πŸ’… custom color era.

πŸ’œ EXAMPLES πŸ’œ

use the ncargex command to see the following relevant examples, go run them and be obsessed:

  • srex01
  • tpwrzs
  • tsrfac
  • fsrpwrzs
  • fsrsrfac

πŸ‘‘ ACCESS πŸ‘‘

to use SRFACE or c_srface, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c β€” preferably in that order. don't get cute with the order, bestie, just do it that way.


🧚 SEE ALSO 🧚

Online: surface, surface_params, ezsrfc, pwrzs, setr, ncarg_cbind.

Hardcopy: NCAR Graphics Fundamentals, UNIX Version


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 thing, you ate that πŸ’…βœ¨

this lil masterpiece lives in the UNIX corner of the manual, dated March 1993, filed under SRFACE(3NCARG) β€” and it's brought to you by the NCAR GRAPHICS girlies. mwah. πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from