c_css2cd(3NCARG)

πŸ’– c_css2cd β€” the NCAR Graphics girlie's guide to turning lat/lon into XYZ πŸ’–

okay bestie, welcome to the c_css2cd page from the NCAR GRAPHICS manual (3NCARG, if we're being official about it). she's a C function, she's double precision, and she is so ready to convert your latitude/longitude coordinates into Cartesian ones. let's get into it ✨


✨ NAME ✨

c_css2cd β€” convert from lat/lon coordinates to Cartesian coordinates. that's it, that's the job, and she does it flawlessly πŸ’…


🫢 FUNCTION PROTOTYPE 🫢

void   c_css2cd(int, double *, double *, double *, double *, double *);

look at her. six args. zero drama. iconic.


πŸŽ€ SYNOPSIS πŸŽ€

c_css2cd(n, rlat, rlon, x, y, z);

🌸 DESCRIPTION 🌸

here's the tea on every single argument, no skipping, no summarizing, we respect the lore:

  • n β€” the number of input lat/lon coordinates. like, how many are we converting today bestie?
  • rlat β€” an array holding the latitudes of the input coordinates, in degrees.
  • rlon β€” an array holding the longitudes of the input coordinates, in degrees. yes, also degrees. both of them. degrees degrees.
  • x β€” an array holding the X component of the Cartesian coordinates of the output data. and the way that (x[i],y[i],z[i]) is the Cartesian coordinate corresponding to the lat/lon coordinate (rlat[i],rlon[i]) for i=0 to n-1?? obsessed. literally the whole mapping in one line πŸ¦‹
  • y β€” an array holding the Y component of the Cartesian coordinates of the output data. and again, (x[i],y[i],z[i]) is the Cartesian coordinate corresponding to the lat/lon coordinate (rlat[i],rlon[i]) for i=0 to n-1. same energy, different axis πŸ’œ
  • z β€” an array holding the Z component of the Cartesian coordinates of the output data. and fr fr, (x[i],y[i],z[i]) is the Cartesian coordinate corresponding to the lat/lon coordinate (rlat[i],rlon[i]) for i=0 to n-1. three for three, she ate πŸ”₯

πŸ’… USAGE πŸ’…

so when do you call her? you call c_css2cd when you need the equivalent Cartesian coordinates on a unit sphere for some latitude and longitude coordinates you already have. unit sphere. not a big sphere, not a small sphere, the unit sphere. periodt.

the vibe check you need to remember: the coordinate of 0. latitude and 0. longitude converts to Cartesian coordinate (1.,0.,0.). that's the anchor point, that's the home base, don't forget it πŸŽ€

latitudes and longitudes are assumed to be in degrees (saying it again because it matters, iykyk).

and the little flex: c_css2cd is a double precision version of c_css2c. so if you wanted the single-precision one, that's a different girl. we're precision girlies over here ✨


⭐ RETURN VALUE ⭐

c_css2cd does not return a value. she gives you everything through x, y, and z and asks for nothing back. main character energy honestly πŸ‘‘


🌈 ACCESS 🌈

to use c_css2cd, load the NCAR Graphics library ngmath. that's the one. don't forget it or she simply will not be there for you 😭


πŸ”₯ SEE ALSO πŸ”₯

go read these too, they're all in the family:

  • css_overview
  • c_cssgrid
  • c_csc2sd

and if you want the full deep dive, complete documentation for Cssgrid lives at this URL:

http://ngwww.ucar.edu/ngdoc/ng/ngmath/cssgrid/csshome.html

Copyright (C) 2000
University Corporation for Atmospheric Research

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

so yeah, it's theirs, and using it means you're playing by the License Agreement. read it, bestie, fr fr πŸ™ˆ


reminder: degrees, unit sphere, (1.,0.,0.) at zero-zero. that's the whole personality. slay.

and that's a wrap on this page from NCAR Graphics β€” UNIX, MAY 2000 edition πŸ’– stay precise, stay double, and go convert some coordinates πŸ¦‹βœ¨