# 2.2.1.7 xyz_renka_nag

## Brief Information

Convert XYZ data to matrix using NAG Renka-Cline gridding

## Command Line Usage

 1. xyz_renka_nag iz:=Col(3); 

2. xyz_renka_nag iz:=Col(3) rows:=10 cols:=10; 

3. xyz_renka_nag iz:=Col(3) om:=[MBook]MSheet!Mat(1); 

## Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input iz

Input

XYZRange

<active>

Specifies the input XYZ range.

Rows rows

Input

int

20

Rows in the output matrix.

Columns cols

Input

int

20

Columns in the output matrix.

Output Matrix om

Output

MatrixObject

<new>

The output matrix.

See the syntax here.

## Description

This function calls NAG library to perform gridding by Renka-Cline method. The method is based on the algorithm that Renka and Cline developed in 1984. It includes three main steps:

1. Triangulation:

Connect all the data points to do a Thiessen triangulation in the X-Y plane, which means that the triangles in the plane are as nearly equiangular as possible.

2. Gradient Estimation:

Estimate a gradient in the x- and y-directions for each node as the partial derivatives of a quadratic function.

3. Interpolation:

For an arbitrary point P, compute the interpolated value using the data values and gradient estimates at each of the three vertices of the triangle which contains P.

For the 200~1000 data points and uniformly distributed case, Renka-Cline method could be a best choice.

## Examples

1. Import XYZ Random Gaussian.dat on the \Samples\Matrix Conversion and Gridding folder.

2. Type xyz_renka_nag 3 in the command window. Or type xyz_renka_nag -d to bring up the dialog.

## Algorithm

Please refer to the NAG help document (e01sac, e01sbc, e01szc) for more information.

## References

. Robert J. Renka, Interpolation of Data on the Surface of a Sphere, 1984, ACM Transactions on Mathematical Software.

. Robert J. Renka, A Triangle-based C1 Interpolation Method, Rocky Mountain J. Math. Vol. 14, 1984, pp. 223-237.

## Related X-Functions

Keywords:worksheet