c_ftkurvpd(3NCARG)

πŸ’– c_ftkurvpd β€” the NCAR Graphics glow-up πŸ’–

okay bestie, sit down, hydrate, and let me tell you about this little icon from the NCAR GRAPHICS manual set. it's c_ftkurvpd, and yes the name is giving "someone fell asleep on the keyboard," but she's literally out here doing interpolation and derivatives for closed parametric curves. main character behavior, no cap. ✨


πŸŽ€ NAME πŸŽ€

c_ftkurvpd β€” interpolation and derivative calculation for closed parametric curves.

like. she interpolates. she differentiates. she closes the loop. she does it all. πŸ’…


🧚 FUNCTION PROTOTYPE 🧚

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

eleven arguments. ELEVEN. not me counting them twice. 😭


🌸 SYNOPSIS 🌸

int c_ftkurvpd (n, xi, yi, m, t, xo, yo, xd, yd, xdd, ydd);

there she is. the whole squad, named and accounted for. 🫢


✨ DESCRIPTION ✨

okay so here's the rundown of every single parameter, and I mean every one, because we do not skip details in this house:

  • n β€” the number of input data points. heads up: n > 1. one point is not a curve, babe, it's a dot. πŸ™ˆ
  • xi β€” an array holding the abscissae for the input function.
  • yi β€” an array holding the functional values (y[k] is the functional value at x[k] for k=0,n).
  • m β€” the number of interpolated points you want. your wish, your command. πŸ‘‘
  • t β€” an array of values for the parameter mapping onto the interpolated curve. any interval [tt,tt+1.] maps onto the entire curve. yes, the whole thing. iconic.
  • xo β€” an array with the X values for the interpolated points. t[k] maps to (xo[k],yo[k]) for k=0,n-1.
  • yo β€” an array with the Y values for the interpolated points. (she's xo's other half, they're a package deal πŸ’œ)
  • xd β€” holds the first derivatives of the X component with respect to t.
  • yd β€” holds the first derivatives of the Y component with respect to t.
  • xdd β€” holds the second derivatives of the X component with respect to t.
  • ydd β€” holds the second derivatives of the Y component with respect to t.

first derivatives AND second derivatives. she's doing the most and honestly? she's eating. πŸ”₯


⭐ RETURN VALUE ⭐

c_ftkurvpd hands you back an error value, and here's the whole menu:

  • = 0 β€” no error. slay. we love a clean run. πŸ’–
  • = 1 β€” if n is less than 2.
  • = 2 β€” if adjacent coordinate pairs coincide.
bestie if you get a 2, your points are literally sitting on top of each other. that's not a curve, that's a situationship. πŸ’€

🌈 USAGE 🌈

so this procedure behaves like ftkurvp except that, on top of everything else, it also returns the first and second derivatives of the component functions in the parameterization. she's ftkurvp with extra credit. πŸŽ“

Given a sequence of distinct input points ( (x[0],y[0]), ... , (x[n-1],y[n-1]), the interpolated curve is parameterized by mapping points in the interval [0.,1.] onto the interpolated curve. The resulting curve has a parametric representation both of whose components are splines under tension and functions of the polygonal arc length. The value 0. is mapped onto (x[0],y[0]) and the value 1. is mapped onto (x[0],y[0]) as well (completing the closed curve).

read that again β€” 0. and 1. land on the same point. that's the closure, that's the whole vibe, the curve comes home. πŸ¦‹

c_ftkurvpd is called after all of the desired values for control parameters have been set using the procedures c_ftseti, c_ftsetr, c_ftsetc. The only control parameter that applies to c_ftkurvpd is: sig.

and what does sig do? 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).

so: tiny sig = smooth girly cubic spline 🌊, huge sig = basically a polygon, no curves, all edges πŸ“, and 1. is the default because it's the moment. periodt.


πŸ“ ACCESS πŸ“

To use c_ftkurvpd, load the NCAR Graphics library ngmath. that's the key to the whole fitgrid universe, iykyk. πŸ”‘


πŸ’œ 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

go read the lore, bestie, there's a whole extended universe. πŸ“š


Copyright (C) 2000 University Corporation for Atmospheric Research

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


and that's the page!! πŸ’– you made it all the way to the bottom, which honestly deserves a little reward. this was c_ftkurvpd(3NCARG) from the UNIX manual, dated March 1998 β€” yeah, she's an elder but she still serves. go make some closed parametric curves with derivatives, you gorgeous genius. πŸŽ€βœ¨πŸ¦‹πŸ’