1c_csa2s(3NCARG) NCAR GRAPHICS c_csa2s(3NCARG)
2
3
4
6 c_csa2s - cubic spline approximation, simple entry for two-dimensional
7 input, gridded output
8
10 float *c_csa2s(int, float [], float [], float [], int [],
11 int, int, float [], float [], int *);
12
13
15 int c_csa2s(int n, float xi[], float yi[], float zi[], int knots[2],
16 int no, int mo, float xo[], float yo[], int *ier);
17
18
20 n (integer,input) The number of input data points. It must be
21 that n is greater than 3 and, depending on the size of
22 knots below, n may have to be larger.
23
24 xi (real, input) An array dimensioned for n containing the X
25 coordinate values for the input function.
26
27 yi (real, input) An array dimensioned for n containing the Y
28 coordinate values for the input function.
29
30 zi (real, input) An array containing the functional values of
31 the input function -- zi[k] is the functional value at
32 (xi[k], yi[k]) for k=0,n-1.
33
34 knots (integer, input) The number of knots to be used in each
35 coordinate direction in constructing the approximation
36 spline. knots[0] and knots[1] must be at least 4. The
37 larger the value for knots, the closer the approximated
38 curve will come to passing through the input function val‐
39 ues.
40
41 no (integer, input) The number of X coordinate values to be
42 calculated for the output surface.
43
44 mo (integer, input) The number of Y coordinate values to be
45 calculated for the output surface.
46
47 xo (real, input) An array dimensioned for no containing the X
48 coordinates of the output grid.
49
50 yo (real, output) An array dimensioned for mo containing the Y
51 coordinates of the output grid.
52
53 ier (pointer to integer, output) An error return value. If *ier
54 is returned as 0, then no errors were detected. If *ier is
55 non-zero, then refer to the error list in the error table
56 for details.
57
59 c_csa2s is called to find an approximating cubic spline surface for
60 two-dimensional input data. If you want to weight the input data val‐
61 ues, calculate derivatives, or handle data sparse areas specially, then
62 you will need to use c_csa2xs.
63
64 c_csa2s returns a pointer to a linear array of data that is the approx‐
65 imated grid stored in row-major order. That is, if out is declared as
66
67 float *out;
68
69 and we set:
70
71 out = c_csa2s(n, x, y, z, knots, no, mo, xo, yo, &ier);
72
73 then out[i*mo+j] is the approximated function value at coordinate point
74 (xo[i], yo[j]) for 0 <= i < no and 0 <= j < mo. The space for out is
75 allocated internal to c_csa2s and is no * mo floats in size.
76
78 To use c_csa2s, load the NCAR Graphics library ngmath.
79
81 csagrid, c_csa2xs, c_csa2ls, c_csa2lxs
82
83 Complete documentation for Csagrid is available at URL
84 http://ngwww.ucar.edu/ngdoc/ng/ngmath/csagrid/csahome.html
85
87 Copyright (C) 2000
88 University Corporation for Atmospheric Research
89
90 The use of this Software is governed by a License Agreement.
91
92
93
94UNIX January 1999 c_csa2s(3NCARG)