CRVLENGTH

The CRVLENGTH function computes the length of a curve with a tabular representation, Y [ i ] = F( X [ i ]).

This routine is written in the IDL language. Its source code can be found in the file crvlength.pro in the lib subdirectory of the IDL distribution.

Calling Sequence

Result = CRVLENGTH( X , Y )

Arguments

X

An n -element single- or double-precision floating-point vector. X must contain at least three elements, and values must be specified in ascending order. Duplicate X values will result in a warning message.

Y

An n -element single- or double-precision floating-point vector.

Keyword

DOUBLE

Set this keyword to force the computation to be done in double-precision arithmetic.

Example

Define a 21-element vector of X -values.

x = [-2.00, -1.50, -1.00, -0.50, 0.00, 0.50, 1.00, 1.50, 2.00, $

2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 5.50, 6.00, 6.50, $

7.00, 7.50, 8.00]

Define a 21-element vector of Y -values.

y = [-2.99, -2.37, -1.64, -0.84, 0.00, 0.84, 1.64, 2.37, 2.99, $

3.48, 3.86, 4.14, 4.33, 4.49, 4.65, 4.85, 5.13, 5.51, $

6.02, 6.64, 7.37]

result = CRVLENGTH(x, y) ; Compute the length of the curve .

Print, result ; Print result.

IDL prints:

14.8115

See Also

INT_TABULATED , PNT_LINE