c_ftcurvs1(3NCARG)

✨ c_ftcurvs1 ✨ β€” the NCAR Graphics girlie's guide πŸ’–

okay so bestie, welcome to the NCAR GRAPHICS corner of the UNIX manual, and today's main character is c_ftcurvs1 πŸ’… she's a C function that calculates values for a smoothing spline for data in the plane. yes. a spline. in a plane. she's giving geometry, she's giving curve, she's giving tension (literally, there's a tension parameter, we'll get there πŸŽ€).


🌸 NAME 🌸

c_ftcurvs1 β€” calculate values for a smoothing spline for data in the plane.

like, that's her whole thing. that's the job. no cap. ✨


πŸ¦‹ FUNCTION PROTOTYPE πŸ¦‹

int c_ftcurvs1(int, float [], float [], int, float [],
               int, float, float, float [], float []);

πŸ’– SYNOPSIS πŸ’–

int c_ftcurvs1(int n, float xi[], float yi[], int dflg,
               float d[], int m, float xl, float xr,
               float xo[], float yo[])

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so here's every single argument, explained with love, and I am NOT skipping any of them, periodt:

  • n β€” the number of input data points. note that she requires n > 1, so a single lonely point will NOT cut it, bestie. 😭
  • xi β€” an array holding the X-coordinates for the input data. and listen β€” these do not need to be increasing. chaotic order? she can handle it. πŸ™ˆ
  • yi β€” an array holding the Y-coordinates for the input data.
  • dflg β€” a switch that tells her how to read the value of d (details below, keep scrolling 🫢). if dflg=0, then d is an array of length n β€” that's one error estimate for each input data value. if dflg=1, then d is a scalar that serves as the error estimate for every single data item. one number to rule them all. πŸ‘‘
  • d β€” a user-specified value containing the observed weights. d may be either an array or a scalar, depending on the value of dflg. (so like, she's flexible. we love that for her. πŸ’…)
  • m β€” the number of output values.
  • xl β€” a lower limit for an interval of interpolation. the interval between zero and one interpolates the entire curve, and any value outside this range results in extrapolation. the interval [xl,xr] is divided into m equal values to produce the interpolated curve. ⭐
  • xr β€” an upper limit for an interval of interpolation. same vibe: the interval between zero and one interpolates the entire curve, anything outside that range means extrapolation, and [xl,xr] gets divided into m equal values to produce the interpolated curve.
  • xo β€” the interpolated X values. πŸŽ€
  • yo β€” the interpolated Y values. πŸŽ€

🌈 RETURN VALUE 🌈

c_ftcurvs1 returns an error value as per:

  • = 1 if n is less than 2.
  • = 2 if smt is negative.
  • = 3 if eps is negative or greater than 1.
  • = 5 if d is negative.

like she will tell you what went wrong, she's communicative, she's healthy. πŸ’€ (also notice: no 4. she simply does not acknowledge a 4. iykyk.)


πŸ”₯ USAGE πŸ”₯

This function computes an interpolatory smoothing spline under tension through a sequence of data values in the plane. yes bestie, under tension. she's dramatic like that. 🎭

Two parameters and one function argument are used to control the degree of smoothness β€” the parameters are smt, and eps, and the function argument is d.

The argument d is a value indicating the degree of confidence in the accuracy of the input function values β€” it should be an approximation of the standard deviation of error. Effectively the value of d controls how close the smoothed curve comes to the input data points. If d is small, then the interpolated curve will pass close to the input data. The larger the value of d, the more freedom the smooth curve has in how close it comes to the input data values. so like… small d = clingy curve, big d = independent curve who doesn't need you. 🌸

The parameter smt is a more subtle global smoothing parameter; smt must be non-negative. For small values of smt, the curve approximates the tension spline, and for larger values of smt, the curve is smoother. A reasonable value for smt is (float) n. smt can be set with the procedure c_ftsetr.

The parameter eps controls the precision to which smt is interpreted; eps must be between 0. and 1. inclusive. A reasonable value for eps is sqrt( 2./(float) n ). eps can be set with the procedure c_ftsetr.

c_ftcurvs1 is called after all of the desired values for control parameters have been set using the procedures c_ftseti, c_ftsetr, c_ftsetc. Control parameters that apply to c_ftcurvs are: sig, smt, eps, sf2.

The value for the parameter sig specifies the tension factor. Values near zero result in a cubic spline; large values (e.g. 50) result in nearly a polygonal line. A typical value is 1. (the default). ⭐


πŸ’œ ACCESS πŸ’œ

To use c_ftcurvs1, load the NCAR Graphics library ngmath.

bestie if you forget to link ngmath she will simply not appear and you will be sad. link the library. 🫢

🧚 SEE ALSO 🧚

  • fitgrid_params
  • c_ftseti
  • c_ftsetr
  • c_ftsetc

Complete documentation for Fitgrid is available at URL http://ngwww.ucar.edu/ngdoc/ng/ngmath/fitgrid/fithome.html


Copyright (C) 2000 University Corporation for Atmospheric Research

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


okay that's the whole page, and now the cute sign-off: this little icon was living in the UNIX manual, sourced from the NCAR GRAPHICS crew, dated August 2002 β€” and she's still out here slaying splines. c_ftcurvs1(3NCARG), signing off. πŸ’…βœ¨ no cap, go plot something beautiful. πŸŒˆπŸ¦‹πŸ’–