Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

CRVLENGTH


Syntax | Return Value | Arguments | Keywords | Example | Version History | See Also

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

Warning
Data that is highly oscillatory requires a sufficient number of samples for an accurate curve length computation.

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.

Syntax

Result = CRVLENGTH( X, Y [, /DOUBLE] )

Return Value

Returns the curve length.

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.

Keywords

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] 
 
;Compute the length of the curve: 
result = CRVLENGTH(x, y) 
 
Print, result 

IDL prints:

14.8115 

Version History

Introduced: 5.0

See Also

INT_TABULATED, PNT_LINE


Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]