On 7/21/07, Alfonso Salazar <[EMAIL PROTECTED]> wrote:
I am looking for a function in order to calculate
cubic splines.

Here's a function (C) which calculates the spline polynomials
for a cubic spline for a one dimensional closed curve.

D=: (1&|. + 4&* + _1&|.)@[EMAIL PROTECTED]@# %. 3 * 1&|. - _1&|.
m=.".;._2]0 :0
 1  0  0  0
 0  1  0  0
_3 _1  3 _1
 2  1 _2  1
)
C=: m +/ .* (],1&|.)@(,:D)

If that is not what you are looking for, and if the spline routines
that Patrick Harrington posted are not what you are looking for,
could you be more specific?

--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to