nag_2d_triang_bary_eval (e01ebc) (PDF version)
e01 Chapter Contents
e01 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_2d_triang_bary_eval (e01ebc)

 Contents

    1  Purpose
    7  Accuracy
    10  Example

1  Purpose

nag_2d_triang_bary_eval (e01ebc) performs barycentric interpolation, at a given set of points, using a set of function values on a scattered grid and a triangulation of that grid computed by nag_2d_triangulate (e01eac).

2  Specification

#include <nag.h>
#include <nage01.h>
void  nag_2d_triang_bary_eval (Integer m, Integer n, const double x[], const double y[], const double f[], const Integer triang[], const double px[], const double py[], double pf[], NagError *fail)

3  Description

nag_2d_triang_bary_eval (e01ebc) takes as input a set of scattered data points xr,yr,fr , for r=1,2,,n, and a Thiessen triangulation of the xr,yr computed by nag_2d_triangulate (e01eac), and interpolates at a set of points pxi,pyi , for i=1,2,,m.
If the ith interpolation point pxi,pyi  is equal to xr,yr  for some value of r, the returned value will be equal to fr; otherwise a barycentric transformation will be used to calculate the interpolant.
For each point pxi,pyi , a triangle is sought which contains the point; the vertices of the triangle and fr values at the vertices are then used to compute the value F pxi,pyi .
If any interpolation point lies outside the triangulation defined by the input arguments, the returned value is the value provided, fs, at the closest node xs,ys .
nag_2d_triang_bary_eval (e01ebc) must only be called after a call to nag_2d_triangulate (e01eac).

4  References

Cline A K and Renka R L (1984) A storage-efficient method for construction of a Thiessen triangulation Rocky Mountain J. Math. 14 119–139
Lawson C L (1977) Software for C1 surface interpolation Mathematical Software III (ed J R Rice) 161–194 Academic Press
Renka R L (1984) Algorithm 624: triangulation and interpolation of arbitrarily distributed points in the plane ACM Trans. Math. Software 10 440–442
Renka R L and Cline A K (1984) A triangle-based C1 interpolation method Rocky Mountain J. Math. 14 223–237

5  Arguments

1:     m IntegerInput
On entry: m, the number of points to interpolate.
Constraint: m1.
2:     n IntegerInput
On entry: n, the number of data points. n must be unchanged from the previous call of nag_2d_triangulate (e01eac).
Constraint: n3.
3:     x[n] const doubleInput
4:     y[n] const doubleInput
On entry: the coordinates of the rth data point, xr,yr, for r=1,2,,n. x and y must be unchanged from the previous call of nag_2d_triangulate (e01eac).
5:     f[n] const doubleInput
On entry: the function values fr at xr,yr, for r=1,2,,n.
6:     triang[7×n] const IntegerInput
On entry: the triangulation computed by the previous call of nag_2d_triangulate (e01eac). See Section 9 in nag_2d_triangulate (e01eac) for details of how the triangulation used is encoded in triang.
7:     px[m] const doubleInput
8:     py[m] const doubleInput
On entry: the coordinates pxi,pyi, for i=1,2,,m, at which interpolated function values are sought.
9:     pf[m] doubleOutput
On exit: the interpolated values Fpxi,pyi, for i=1,2,,m.
10:   fail NagError *Input/Output
The NAG error argument (see Section 2.7 in How to Use the NAG Library and its Documentation).

6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_INT
On entry, m=value.
Constraint: m1.
On entry, n=value.
Constraint: n3.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
An unexpected error has been triggered by this function. Please contact NAG.
See Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
NE_TRIANG_INVALID
On entry, the triangulation information held in the array triang does not specify a valid triangulation of the data points. triang has been corrupted since the call to nag_2d_triangulate (e01eac).
NW_EXTRAPOLATION
At least one evaluation point lies outside the nodal triangulation. For each such point the value returned in pf is that corresponding to a node on the closest boundary line segment.

7  Accuracy

Not applicable.

8  Parallelism and Performance

nag_2d_triang_bary_eval (e01ebc) is not threaded in any implementation.

9  Further Comments

The time taken for a call of nag_2d_triang_bary_eval (e01ebc) is approximately proportional to the number of interpolation points, m.

10  Example

See Section 10 in nag_2d_triangulate (e01eac).

nag_2d_triang_bary_eval (e01ebc) (PDF version)
e01 Chapter Contents
e01 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2016