SRFACE(3NCARG)
β¨ 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,NXlong, holding the X coordinates of the points in the surface approximation. peep the USAGE section below, iykyk.Yβ the linear array,NYlong, holding the Y coordinates of the points in the surface approximation. again, USAGE is right there.Zβ an array that'sMXbyNY, containing the surface to be drawn inNXbyNYcells.Z(I,J) = F(X(I),Y(J)). yes literally, that's the formula. USAGE, go look.Mβ scratch array. at least2*NX*NYwords long. it's just there to hold stuff, don't ask questions πMXβ first dimension ofZ.NXβ number of data values in the X direction (the first subscript direction) inZto 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βSdefines 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.0means no stereo pair (one picture). non-zero means put out two pictures. the value ofSTEREOis the relative angle between the eyes. a value of1.0produces standard separation. negativeSTEREOreverses 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 arraynybymx.mxβ second dimension ofz.nxβ number of data values in the y direction (the second subscript direction) inzto 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
Zcompared with the range ofXandYdetermines the shape of the picture. they're assumed to be in the same units and not wildly different in magnitude.Sis assumed to be in the same units asX,Y, andZ. - picture size can be made relative to distance.
TRN32Scan 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
+Zaxis. 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 index1before callingSRFACE, or by putting the common blockSRFINTin his calling program and defining and using color indexISRFMJ(defaulted to1inBLOCKDATA). π custom color era.
π EXAMPLES π
use the ncargex command to see the following relevant examples, go run them and be obsessed:
srex01tpwrzstsrfacfsrpwrzsfsrsrfac
π 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 πΈ
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
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms