#### Description:

This function applies a Mapping to transform the coordinates of a set of points in an arbitrary number of dimensions. It is the appropriate routine to use if the coordinates are not purely 1- or 2-dimensional and are stored in separate arrays, since each coordinate array is located by supplying a separate pointer to it.

If the coordinates are stored in a single (2-dimensional) array, then the astTranN function might be more suitable.

#### Synopsis

void astTranP( AstMapping ∗this, int npoint, int ncoord_in, const double ∗ptr_in[], int forward, int ncoord_out, double ∗ptr_out[] )

#### Parameters:

##### this

Pointer to the Mapping to be applied.

##### npoint

The number of points to be transformed.

##### ncoord_in

The number of coordinates being supplied for each input point (i.e. the number of dimensions of the space in which the input points reside).

##### ptr_in

An array of pointers to double, with `"` ncoord_in`"` elements. Element `"` ptr_in[coord]`"` should point at the first element of an array of double (with `"` npoint`"` elements) which contain the values of coordinate number `"` coord`"` for each input (untransformed) point. The value of coordinate number `"` coord`"` for input point number `"` point`"` is therefore given by `"` ptr_in[coord][point]`"` (assuming both indices are zero-based).

##### forward

A non-zero value indicates that the Mapping`’` s forward coordinate transformation is to be applied, while a zero value indicates that the inverse transformation should be used.

##### ncoord_out

The number of coordinates being generated by the Mapping for each output point (i.e. the number of dimensions of the space in which the output points reside). This need not be the same as `"` ncoord_in`"` .

##### ptr_out

An array of pointers to double, with `"` ncoord_out`"` elements. Element `"` ptr_out[coord]`"` should point at the first element of an array of double (with `"` npoint`"` elements) into which the values of coordinate number `"` coord`"` for each output (transformed) point will be written. The value of coordinate number `"` coord`"` for output point number `"` point`"` will therefore be found in `"` ptr_out[coord][point]`"` .

#### Notes:

- If the forward coordinate transformation is being applied, the Mapping supplied must have the value of `"` ncoord_in`"` for its Nin attribute and the value of `"` ncoord_out`"` for its Nout attribute. If the inverse transformation is being applied, these values should be reversed.

- This routine is not available in the Fortran 77 interface to the AST library.

#### Handling of Huge Pixel Arrays

If the number of points to be transformed exceeds the largest value that can be represented by a 4-byte integer, then the alternative `"` 8-byte`"` interface for this function should be used. This alternative interface uses 8 byte integer arguments (instead of 4-byte). Specifically, the argument `"` npoint`"` , is changed from type `"` int`"` to type `"` int64_t`"` (defined in header file stdint.h). The function name is changed by appending the digit `"` 8`"` to the name. Thus, astTranP becomes astTranP8.
Copyright (C) 2021 East Asian Observatory