prj.h File Reference
`#include "wcserr.h"`

Go to the source code of this file.

## Data Structures

struct | prjprm
| Projection parameters. More...

## Macros

#define | PVN 30
| Total number of projection parameters. More...
#define | PRJX2S_ARGS
| For use in declaring deprojection function prototypes. More...
#define | PRJS2X_ARGS
| For use in declaring projection function prototypes. More...
#define | PRJLEN (sizeof(struct prjprm)/sizeof(int))
| Size of the prjprm struct in int units. More...
#define | prjini_errmsg prj_errmsg
| Deprecated. More...
#define | prjprt_errmsg prj_errmsg
| Deprecated. More...
#define | prjset_errmsg prj_errmsg
| Deprecated. More...
#define | prjx2s_errmsg prj_errmsg
| Deprecated. More...
#define | prjs2x_errmsg prj_errmsg
| Deprecated. More...

## Enumerations

enum | prj_errmsg_enum { PRJERR_SUCCESS = 0, PRJERR_NULL_POINTER = 1, PRJERR_BAD_PARAM = 2, PRJERR_BAD_PIX = 3, PRJERR_BAD_WORLD = 4 }

## Functions

int | prjini (struct prjprm *prj)
| Default constructor for the prjprm struct. More...
int | prjfree (struct prjprm *prj)
| Destructor for the prjprm struct. More...
int | prjprt (const struct prjprm *prj)
| Print routine for the prjprm struct. More...
int | prjbchk (double tol, int nx, int ny, int spt, double phi[], double theta[], int stat[])
| Bounds checking on native coordinates. More...
int | prjset (struct prjprm *prj)
| Generic setup routine for the prjprm struct. More...
int | prjx2s (PRJX2S_ARGS)
| Generic Cartesian-to-spherical deprojection. More...
int | prjs2x (PRJS2X_ARGS)
| Generic spherical-to-Cartesian projection. More...
int | azpset (struct prjprm *prj)
| Set up a prjprm struct for the zenithal/azimuthal perspective (`AZP`) projection. More...
int | azpx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the zenithal/azimuthal perspective (`AZP`) projection. More...
int | azps2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the zenithal/azimuthal perspective (`AZP`) projection. More...
int | szpset (struct prjprm *prj)
| Set up a prjprm struct for the slant zenithal perspective (`SZP`) projection. More...
int | szpx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the slant zenithal perspective (`SZP`) projection. More...
int | szps2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the slant zenithal perspective (`SZP`) projection. More...
int | tanset (struct prjprm *prj)
| Set up a prjprm struct for the gnomonic (`TAN`) projection. More...
int | tanx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the gnomonic (`TAN`) projection. More...
int | tans2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the gnomonic (`TAN`) projection. More...
int | stgset (struct prjprm *prj)
| Set up a prjprm struct for the stereographic (`STG`) projection. More...
int | stgx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the stereographic (`STG`) projection. More...
int | stgs2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the stereographic (`STG`) projection. More...
int | sinset (struct prjprm *prj)
| Set up a prjprm struct for the orthographic/synthesis (`SIN`) projection. More...
int | sinx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the orthographic/synthesis (`SIN`) projection. More...
int | sins2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the orthographic/synthesis (`SIN`) projection. More...
int | arcset (struct prjprm *prj)
| Set up a prjprm struct for the zenithal/azimuthal equidistant (`ARC`) projection. More...
int | arcx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the zenithal/azimuthal equidistant (`ARC`) projection. More...
int | arcs2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the zenithal/azimuthal equidistant (`ARC`) projection. More...
int | zpnset (struct prjprm *prj)
| Set up a prjprm struct for the zenithal/azimuthal polynomial (`ZPN`) projection. More...
int | zpnx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the zenithal/azimuthal polynomial (`ZPN`) projection. More...
int | zpns2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the zenithal/azimuthal polynomial (`ZPN`) projection. More...
int | zeaset (struct prjprm *prj)
| Set up a prjprm struct for the zenithal/azimuthal equal area (`ZEA`) projection. More...
int | zeax2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the zenithal/azimuthal equal area (`ZEA`) projection. More...
int | zeas2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the zenithal/azimuthal equal area (`ZEA`) projection. More...
int | airset (struct prjprm *prj)
| Set up a prjprm struct for Airy's (`AIR`) projection. More...
int | airx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for Airy's (`AIR`) projection. More...
int | airs2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for Airy's (`AIR`) projection. More...
int | cypset (struct prjprm *prj)
| Set up a prjprm struct for the cylindrical perspective (`CYP`) projection. More...
int | cypx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the cylindrical perspective (`CYP`) projection. More...
int | cyps2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the cylindrical perspective (`CYP`) projection. More...
int | ceaset (struct prjprm *prj)
| Set up a prjprm struct for the cylindrical equal area (`CEA`) projection. More...
int | ceax2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the cylindrical equal area (`CEA`) projection. More...
int | ceas2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the cylindrical equal area (`CEA`) projection. More...
int | carset (struct prjprm *prj)
| Set up a prjprm struct for the plate carrée (`CAR`) projection. More...
int | carx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the plate carrée (`CAR`) projection. More...
int | cars2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the plate carrée (`CAR`) projection. More...
int | merset (struct prjprm *prj)
| Set up a prjprm struct for Mercator's (`MER`) projection. More...
int | merx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for Mercator's (`MER`) projection. More...
int | mers2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for Mercator's (`MER`) projection. More...
int | sflset (struct prjprm *prj)
| Set up a prjprm struct for the Sanson-Flamsteed (`SFL`) projection. More...
int | sflx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the Sanson-Flamsteed (`SFL`) projection. More...
int | sfls2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the Sanson-Flamsteed (`SFL`) projection. More...
int | parset (struct prjprm *prj)
| Set up a prjprm struct for the parabolic (`PAR`) projection. More...
int | parx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the parabolic (`PAR`) projection. More...
int | pars2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the parabolic (`PAR`) projection. More...
int | molset (struct prjprm *prj)
| Set up a prjprm struct for Mollweide's (`MOL`) projection. More...
int | molx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for Mollweide's (`MOL`) projection. More...
int | mols2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for Mollweide's (`MOL`) projection. More...
int | aitset (struct prjprm *prj)
| Set up a prjprm struct for the Hammer-Aitoff (`AIT`) projection. More...
int | aitx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the Hammer-Aitoff (`AIT`) projection. More...
int | aits2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the Hammer-Aitoff (`AIT`) projection. More...
int | copset (struct prjprm *prj)
| Set up a prjprm struct for the conic perspective (`COP`) projection. More...
int | copx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the conic perspective (`COP`) projection. More...
int | cops2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the conic perspective (`COP`) projection. More...
int | coeset (struct prjprm *prj)
| Set up a prjprm struct for the conic equal area (`COE`) projection. More...
int | coex2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the conic equal area (`COE`) projection. More...
int | coes2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the conic equal area (`COE`) projection. More...
int | codset (struct prjprm *prj)
| Set up a prjprm struct for the conic equidistant (`COD`) projection. More...
int | codx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the conic equidistant (`COD`) projection. More...
int | cods2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the conic equidistant (`COD`) projection. More...
int | cooset (struct prjprm *prj)
| Set up a prjprm struct for the conic orthomorphic (`COO`) projection. More...
int | coox2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the conic orthomorphic (`COO`) projection. More...
int | coos2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the conic orthomorphic (`COO`) projection. More...
int | bonset (struct prjprm *prj)
| Set up a prjprm struct for Bonne's (`BON`) projection. More...
int | bonx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for Bonne's (`BON`) projection. More...
int | bons2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for Bonne's (`BON`) projection. More...
int | pcoset (struct prjprm *prj)
| Set up a prjprm struct for the polyconic (`PCO`) projection. More...
int | pcox2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the polyconic (`PCO`) projection. More...
int | pcos2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the polyconic (`PCO`) projection. More...
int | tscset (struct prjprm *prj)
| Set up a prjprm struct for the tangential spherical cube (`TSC`) projection. More...
int | tscx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the tangential spherical cube (`TSC`) projection. More...
int | tscs2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the tangential spherical cube (`TSC`) projection. More...
int | cscset (struct prjprm *prj)
| Set up a prjprm struct for the COBE spherical cube (`CSC`) projection. More...
int | cscx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the COBE spherical cube (`CSC`) projection. More...
int | cscs2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the COBE spherical cube (`CSC`) projection. More...
int | qscset (struct prjprm *prj)
| Set up a prjprm struct for the quadrilateralized spherical cube (`QSC`) projection. More...
int | qscx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the quadrilateralized spherical cube (`QSC`) projection. More...
int | qscs2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the quadrilateralized spherical cube (`QSC`) projection. More...
int | hpxset (struct prjprm *prj)
| Set up a prjprm struct for the HEALPix (`HPX`) projection. More...
int | hpxx2s (PRJX2S_ARGS)
| Cartesian-to-spherical transformation for the HEALPix (`HPX`) projection. More...
int | hpxs2x (PRJS2X_ARGS)
| Spherical-to-Cartesian transformation for the HEALPix (`HPX`) projection. More...
int | xphset (struct prjprm *prj)
int | xphx2s (PRJX2S_ARGS)
int | xphs2x (PRJS2X_ARGS)

## Variables

const char * | prj_errmsg []
| Status return messages. More...
const int | CONIC
| Identifier for conic projections. More...
const int | CONVENTIONAL
| Identifier for conventional projections. More...
const int | CYLINDRICAL
| Identifier for cylindrical projections. More...
const int | POLYCONIC
| Identifier for polyconic projections. More...
const int | PSEUDOCYLINDRICAL
| Identifier for pseudocylindrical projections. More...
const int | QUADCUBE
| Identifier for quadcube projections. More...
const int | ZENITHAL
| Identifier for zenithal/azimuthal projections. More...
const int | HEALPIX
| Identifier for the HEALPix projection. More...
const char | prj_categories [9][32]
| Projection categories. More...
const int | prj_ncode
| The number of recognized three-letter projection codes. More...
const char | prj_codes [28][4]
| Recognized three-letter projection codes. More...

## Detailed Description

These routines implement the spherical map projections defined by the FITS WCS standard. They are based on the prjprm struct which contains all information needed for the computations. The struct contains some members that must be set by the user, and others that are maintained by these routines, somewhat like a C++ class but with no encapsulation.

Routine prjini() is provided to initialize the prjprm struct with default values, prjfree() reclaims any memory that may have been allocated to store an error message, and prjprt() prints its contents. prjbchk() performs bounds checking on native spherical coordinates.

Setup routines for each projection with names of the form ???set(), where "???" is the down-cased three-letter projection code, compute intermediate values in the prjprm struct from parameters in it that were supplied by the user. The struct always needs to be set by the projection's setup routine but that need not be called explicitly - refer to the explanation of prjprm::flag.

Each map projection is implemented via separate functions for the spherical projection, ???s2x(), and deprojection, ???x2s().

A set of driver routines, prjset(), prjx2s(), and prjs2x(), provides a generic interface to the specific projection routines which they invoke via pointers-to-functions stored in the prjprm struct.

In summary, the routines are:

- prjini() Initialization routine for the prjprm struct.
- prjfree() Reclaim memory allocated for error messages.
- prjprt() Print the prjprm struct.

- prjbchk() Bounds checking on native coordinates.

- prjset(), prjx2s(), prjs2x(): Generic driver routines

- azpset(), azpx2s(), azps2x(): `AZP` (zenithal/azimuthal perspective)
- szpset(), szpx2s(), szps2x(): `SZP` (slant zenithal perspective)
- tanset(), tanx2s(), tans2x(): `TAN` (gnomonic)
- stgset(), stgx2s(), stgs2x(): `STG` (stereographic)
- sinset(), sinx2s(), sins2x(): `SIN` (orthographic/synthesis)
- arcset(), arcx2s(), arcs2x(): `ARC` (zenithal/azimuthal equidistant)
- zpnset(), zpnx2s(), zpns2x(): `ZPN` (zenithal/azimuthal polynomial)
- zeaset(), zeax2s(), zeas2x(): `ZEA` (zenithal/azimuthal equal area)
- airset(), airx2s(), airs2x(): `AIR` (Airy)
- cypset(), cypx2s(), cyps2x(): `CYP` (cylindrical perspective)
- ceaset(), ceax2s(), ceas2x(): `CEA` (cylindrical equal area)
- carset(), carx2s(), cars2x(): `CAR` (Plate carée)
- merset(), merx2s(), mers2x(): `MER` (Mercator)
- sflset(), sflx2s(), sfls2x(): `SFL` (Sanson-Flamsteed)
- parset(), parx2s(), pars2x(): `PAR` (parabolic)
- molset(), molx2s(), mols2x(): `MOL` (Mollweide)
- aitset(), aitx2s(), aits2x(): `AIT` (Hammer-Aitoff)
- copset(), copx2s(), cops2x(): `COP` (conic perspective)
- coeset(), coex2s(), coes2x(): `COE` (conic equal area)
- codset(), codx2s(), cods2x(): `COD` (conic equidistant)
- cooset(), coox2s(), coos2x(): `COO` (conic orthomorphic)
- bonset(), bonx2s(), bons2x(): `BON` (Bonne)
- pcoset(), pcox2s(), pcos2x(): `PCO` (polyconic)
- tscset(), tscx2s(), tscs2x(): `TSC` (tangential spherical cube)
- cscset(), cscx2s(), cscs2x(): `CSC` (COBE spherical cube)
- qscset(), qscx2s(), qscs2x(): `QSC` (quadrilateralized spherical cube)
- hpxset(), hpxx2s(), hpxs2x(): `HPX` (HEALPix)
- xphset(), xphx2s(), xphs2x(): XPH (HEALPix polar, aka "butterfly")

Argument checking (projection routines):
The values of and (the native longitude and latitude) normally lie in the range for , and for . However, all projection routines will accept any value of and will not normalize it.

The projection routines do not explicitly check that lies within the range . They do check for any value of that produces an invalid argument to the projection equations (e.g. leading to division by zero). The projection routines for `AZP`, `SZP`, `TAN`, `SIN`, `ZPN`, and `COP` also return error 2 if corresponds to the overlapped (far) side of the projection but also return the corresponding value of . This strict bounds checking may be relaxed at any time by setting prjprm::bounds%2 to 0 (rather than 1); the projections need not be reinitialized.

Argument checking (deprojection routines):
Error checking on the projected coordinates is limited to that required to ascertain whether a solution exists. Where a solution does exist, an optional check is made that the value of and obtained lie within the ranges for , and for . This check, performed by prjbchk(), is enabled by default. It may be disabled by setting prjprm::bounds%4 to 0 (rather than 1); the projections need not be reinitialized.

Accuracy:
No warranty is given for the accuracy of these routines (refer to the copyright notice); intending users must satisfy for themselves their adequacy for the intended purpose. However, closure to a precision of at least of longitude and latitude has been verified for typical projection parameters on the degree graticule of native longitude and latitude (to within of any latitude where the projection may diverge). Refer to the tprj1.c and tprj2.c test routines that accompany this software.

## Macro Definition Documentation

#define PVN 30

The total number of projection parameters numbered 0 to PVN-1.

#define PRJX2S_ARGS

Value:
struct prjprm *prj, int nx, int ny, int sxy, int spt, \
const double x[], const double y[], double phi[], double theta[], int stat[]

Preprocessor macro used for declaring deprojection function prototypes.

#define PRJS2X_ARGS

Value:
struct prjprm *prj, int nx, int ny, int sxy, int spt, \
const double phi[], const double theta[], double x[], double y[], int stat[]

Preprocessor macro used for declaring projection function prototypes.

#define PRJLEN (sizeof(struct prjprm)/sizeof(int))

Size of the prjprm struct in int units, used by the Fortran wrappers.

#define prjini_errmsg prj_errmsg

Deprecated:
  Added for backwards compatibility, use prj_errmsg directly now instead.

#define prjprt_errmsg prj_errmsg

Deprecated:
  Added for backwards compatibility, use prj_errmsg directly now instead.

#define prjset_errmsg prj_errmsg

Deprecated:
  Added for backwards compatibility, use prj_errmsg directly now instead.

#define prjx2s_errmsg prj_errmsg

Deprecated:
  Added for backwards compatibility, use prj_errmsg directly now instead.

#define prjs2x_errmsg prj_errmsg

Deprecated:
  Added for backwards compatibility, use prj_errmsg directly now instead.

## Enumeration Type Documentation

enum prj_errmsg_enum

Enumerator
PRJERR_SUCCESS |
PRJERR_NULL_POINTER |
PRJERR_BAD_PARAM |
PRJERR_BAD_PIX |
PRJERR_BAD_WORLD |

## Function Documentation

int prjini | ( | struct prjprm * | prj) |  |

prjini() sets all members of a prjprm struct to default values. It should be used to initialize every prjprm struct.

Parameters

  [out] | prj | Projection parameters.

Returns
  Status return value:
  - 0: Success.
  - 1: Null prjprm pointer passed.

int prjfree | ( | struct prjprm * | prj) |  |

prjfree() frees any memory that may have been allocated to store an error message in the prjprm struct.

Parameters

  [in] | prj | Projection parameters.

Returns
  Status return value:
  - 0: Success.
  - 1: Null prjprm pointer passed.

int prjprt | ( | const struct prjprm * | prj) |  |

prjprt() prints the contents of a prjprm struct using wcsprintf(). Mainly intended for diagnostic purposes.

Parameters

  [in] | prj | Projection parameters.

Returns
  Status return value:
  - 0: Success.
  - 1: Null prjprm pointer passed.

int prjbchk | ( | double | tol,
|  | int | nx,
|  | int | ny,
|  | int | spt,
|  | double | phi[],
|  | double | theta[],
|  | int | stat[]
| ) |  |

prjbchk() performs bounds checking on native spherical coordinates. As returned by the deprojection (x2s) routines, native longitude is expected to lie in the closed interval , with latitude in .

A tolerance may be specified to provide a small allowance for numerical imprecision. Values that lie outside the allowed range by not more than the specified tolerance will be adjusted back into range.

If prjprm::bounds&4 is set, as it is by prjini(), then prjbchk() will be invoked automatically by the Cartesian-to-spherical deprojection (x2s) routines with an appropriate tolerance set for each projection.

Parameters

  [in] | tol | Tolerance for the bounds check [deg].
  [in] | nphi,ntheta | Vector lengths.
  [in] | spt | Vector stride.
  [in,out] | phi,theta | Native longitude and latitude [deg].

  [out]

  stat

  Status value for each vector element:
  - 0: Valid value of .
  - 1: Invalid value.

Returns
  Status return value:
  - 0: Success.
  - 1: One or more of the coordinates were, invalid, as indicated by the stat vector.

int prjset | ( | struct prjprm * | prj) |  |

prjset() sets up a prjprm struct according to information supplied within it.

Note that this routine need not be called directly; it will be invoked by prjx2s() and prjs2x() if prj.flag is anything other than a predefined magic value.

The one important distinction between prjset() and the setup routines for the specific projections is that the projection code must be defined in the prjprm struct in order for prjset() to identify the required projection. Once prjset() has initialized the prjprm struct, prjx2s() and prjs2x() use the pointers to the specific projection and deprojection routines contained therein.

Parameters

  [in,out] | prj | Projection parameters.

Returns
  Status return value:
  - 0: Success.
  - 1: Null prjprm pointer passed.
  - 2: Invalid projection parameters.
  For returns > 1, a detailed error message is set in prjprm::err if enabled, see wcserr_enable().

int prjx2s | ( | PRJX2S_ARGS | ) |  |

Deproject Cartesian coordinates in the plane of projection to native spherical coordinates .

The projection is that specified by prjprm::code.

Parameters

  [in,out] | prj | Projection parameters.
  [in] | nx,ny | Vector lengths.
  [in] | sxy,spt | Vector strides.
  [in] | x,y | Projected coordinates.
  [out] | phi,theta | Longitude and latitude of the projected point in native spherical coordinates [deg].

  [out]

  stat

  Status value for each vector element:
  - 0: Success.
  - 1: Invalid value of .

Returns
  Status return value:
  - 0: Success.
  - 1: Null prjprm pointer passed.
  - 2: Invalid projection parameters.
  - 3: One or more of the coordinates were invalid, as indicated by the stat vector.
  For returns > 1, a detailed error message is set in prjprm::err if enabled, see wcserr_enable().

int prjs2x | ( | PRJS2X_ARGS | ) |  |

Project native spherical coordinates to Cartesian coordinates in the plane of projection.

The projection is that specified by prjprm::code.

Parameters

  [in,out] | prj | Projection parameters.
  [in] | nphi,ntheta | Vector lengths.
  [in] | spt,sxy | Vector strides.
  [in] | phi,theta | Longitude and latitude of the projected point in native spherical coordinates [deg].
  [out] | x,y | Projected coordinates.

  [out]

  stat

  Status value for each vector element:
  - 0: Success.
  - 1: Invalid value of .

Returns
  Status return value:
  - 0: Success.
  - 1: Null prjprm pointer passed.
  - 2: Invalid projection parameters.
  - 4: One or more of the coordinates were, invalid, as indicated by the stat vector.
  For returns > 1, a detailed error message is set in prjprm::err if enabled, see wcserr_enable().

int azpset | ( | struct prjprm * | prj) |  |

azpset() sets up a prjprm struct for a zenithal/azimuthal perspective (`AZP`) projection.

See prjset() for a description of the API.

int azpx2s | ( | PRJX2S_ARGS | ) |  |

azpx2s() deprojects Cartesian coordinates in the plane of a zenithal/azimuthal perspective (`AZP`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int azps2x | ( | PRJS2X_ARGS | ) |  |

azps2x() projects native spherical coordinates to Cartesian coordinates in the plane of a zenithal/azimuthal perspective (`AZP`) projection.

See prjs2x() for a description of the API.

int szpset | ( | struct prjprm * | prj) |  |

szpset() sets up a prjprm struct for a slant zenithal perspective (`SZP`) projection.

See prjset() for a description of the API.

int szpx2s | ( | PRJX2S_ARGS | ) |  |

szpx2s() deprojects Cartesian coordinates in the plane of a slant zenithal perspective (`SZP`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int szps2x | ( | PRJS2X_ARGS | ) |  |

szps2x() projects native spherical coordinates to Cartesian coordinates in the plane of a slant zenithal perspective (`SZP`) projection.

See prjs2x() for a description of the API.

int tanset | ( | struct prjprm * | prj) |  |

tanset() sets up a prjprm struct for a gnomonic (`TAN`) projection.

See prjset() for a description of the API.

int tanx2s | ( | PRJX2S_ARGS | ) |  |

tanx2s() deprojects Cartesian coordinates in the plane of a gnomonic (`TAN`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int tans2x | ( | PRJS2X_ARGS | ) |  |

tans2x() projects native spherical coordinates to Cartesian coordinates in the plane of a gnomonic (`TAN`) projection.

See prjs2x() for a description of the API.

int stgset | ( | struct prjprm * | prj) |  |

stgset() sets up a prjprm struct for a stereographic (`STG`) projection.

See prjset() for a description of the API.

int stgx2s | ( | PRJX2S_ARGS | ) |  |

stgx2s() deprojects Cartesian coordinates in the plane of a stereographic (`STG`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int stgs2x | ( | PRJS2X_ARGS | ) |  |

stgs2x() projects native spherical coordinates to Cartesian coordinates in the plane of a stereographic (`STG`) projection.

See prjs2x() for a description of the API.

int sinset | ( | struct prjprm * | prj) |  |

stgset() sets up a prjprm struct for an orthographic/synthesis (`SIN`) projection.

See prjset() for a description of the API.

int sinx2s | ( | PRJX2S_ARGS | ) |  |

sinx2s() deprojects Cartesian coordinates in the plane of an orthographic/synthesis (`SIN`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int sins2x | ( | PRJS2X_ARGS | ) |  |

sins2x() projects native spherical coordinates to Cartesian coordinates in the plane of an orthographic/synthesis (`SIN`) projection.

See prjs2x() for a description of the API.

int arcset | ( | struct prjprm * | prj) |  |

arcset() sets up a prjprm struct for a zenithal/azimuthal equidistant (`ARC`) projection.

See prjset() for a description of the API.

int arcx2s | ( | PRJX2S_ARGS | ) |  |

arcx2s() deprojects Cartesian coordinates in the plane of a zenithal/azimuthal equidistant (`ARC`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int arcs2x | ( | PRJS2X_ARGS | ) |  |

arcs2x() projects native spherical coordinates to Cartesian coordinates in the plane of a zenithal/azimuthal equidistant (`ARC`) projection.

See prjs2x() for a description of the API.

int zpnset | ( | struct prjprm * | prj) |  |

zpnset() sets up a prjprm struct for a zenithal/azimuthal polynomial (`ZPN`) projection.

See prjset() for a description of the API.

int zpnx2s | ( | PRJX2S_ARGS | ) |  |

zpnx2s() deprojects Cartesian coordinates in the plane of a zenithal/azimuthal polynomial (`ZPN`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int zpns2x | ( | PRJS2X_ARGS | ) |  |

zpns2x() projects native spherical coordinates to Cartesian coordinates in the plane of a zenithal/azimuthal polynomial (`ZPN`) projection.

See prjs2x() for a description of the API.

int zeaset | ( | struct prjprm * | prj) |  |

zeaset() sets up a prjprm struct for a zenithal/azimuthal equal area (`ZEA`) projection.

See prjset() for a description of the API.

int zeax2s | ( | PRJX2S_ARGS | ) |  |

zeax2s() deprojects Cartesian coordinates in the plane of a zenithal/azimuthal equal area (`ZEA`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int zeas2x | ( | PRJS2X_ARGS | ) |  |

zeas2x() projects native spherical coordinates to Cartesian coordinates in the plane of a zenithal/azimuthal equal area (`ZEA`) projection.

See prjs2x() for a description of the API.

int airset | ( | struct prjprm * | prj) |  |

airset() sets up a prjprm struct for an Airy (`AIR`) projection.

See prjset() for a description of the API.

int airx2s | ( | PRJX2S_ARGS | ) |  |

airx2s() deprojects Cartesian coordinates in the plane of an Airy (`AIR`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int airs2x | ( | PRJS2X_ARGS | ) |  |

airs2x() projects native spherical coordinates to Cartesian coordinates in the plane of an Airy (`AIR`) projection.

See prjs2x() for a description of the API.

int cypset | ( | struct prjprm * | prj) |  |

cypset() sets up a prjprm struct for a cylindrical perspective (`CYP`) projection.

See prjset() for a description of the API.

int cypx2s | ( | PRJX2S_ARGS | ) |  |

cypx2s() deprojects Cartesian coordinates in the plane of a cylindrical perspective (`CYP`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int cyps2x | ( | PRJS2X_ARGS | ) |  |

cyps2x() projects native spherical coordinates to Cartesian coordinates in the plane of a cylindrical perspective (`CYP`) projection.

See prjs2x() for a description of the API.

int ceaset | ( | struct prjprm * | prj) |  |

ceaset() sets up a prjprm struct for a cylindrical equal area (`CEA`) projection.

See prjset() for a description of the API.

int ceax2s | ( | PRJX2S_ARGS | ) |  |

ceax2s() deprojects Cartesian coordinates in the plane of a cylindrical equal area (`CEA`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int ceas2x | ( | PRJS2X_ARGS | ) |  |

ceas2x() projects native spherical coordinates to Cartesian coordinates in the plane of a cylindrical equal area (`CEA`) projection.

See prjs2x() for a description of the API.

int carset | ( | struct prjprm * | prj) |  |

carset() sets up a prjprm struct for a plate carrée (`CAR`) projection.

See prjset() for a description of the API.

int carx2s | ( | PRJX2S_ARGS | ) |  |

carx2s() deprojects Cartesian coordinates in the plane of a plate carrée (`CAR`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int cars2x | ( | PRJS2X_ARGS | ) |  |

cars2x() projects native spherical coordinates to Cartesian coordinates in the plane of a plate carrée (`CAR`) projection.

See prjs2x() for a description of the API.

int merset | ( | struct prjprm * | prj) |  |

merset() sets up a prjprm struct for a Mercator (`MER`) projection.

See prjset() for a description of the API.

int merx2s | ( | PRJX2S_ARGS | ) |  |

merx2s() deprojects Cartesian coordinates in the plane of a Mercator (`MER`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int mers2x | ( | PRJS2X_ARGS | ) |  |

mers2x() projects native spherical coordinates to Cartesian coordinates in the plane of a Mercator (`MER`) projection.

See prjs2x() for a description of the API.

int sflset | ( | struct prjprm * | prj) |  |

sflset() sets up a prjprm struct for a Sanson-Flamsteed (`SFL`) projection.

See prjset() for a description of the API.

int sflx2s | ( | PRJX2S_ARGS | ) |  |

sflx2s() deprojects Cartesian coordinates in the plane of a Sanson-Flamsteed (`SFL`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int sfls2x | ( | PRJS2X_ARGS | ) |  |

sfls2x() projects native spherical coordinates to Cartesian coordinates in the plane of a Sanson-Flamsteed (`SFL`) projection.

See prjs2x() for a description of the API.

int parset | ( | struct prjprm * | prj) |  |

parset() sets up a prjprm struct for a parabolic (`PAR`) projection.

See prjset() for a description of the API.

int parx2s | ( | PRJX2S_ARGS | ) |  |

parx2s() deprojects Cartesian coordinates in the plane of a parabolic (`PAR`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int pars2x | ( | PRJS2X_ARGS | ) |  |

pars2x() projects native spherical coordinates to Cartesian coordinates in the plane of a parabolic (`PAR`) projection.

See prjs2x() for a description of the API.

int molset | ( | struct prjprm * | prj) |  |

molset() sets up a prjprm struct for a Mollweide (`MOL`) projection.

See prjset() for a description of the API.

int molx2s | ( | PRJX2S_ARGS | ) |  |

molx2s() deprojects Cartesian coordinates in the plane of a Mollweide (`MOL`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int mols2x | ( | PRJS2X_ARGS | ) |  |

mols2x() projects native spherical coordinates to Cartesian coordinates in the plane of a Mollweide (`MOL`) projection.

See prjs2x() for a description of the API.

int aitset | ( | struct prjprm * | prj) |  |

aitset() sets up a prjprm struct for a Hammer-Aitoff (`AIT`) projection.

See prjset() for a description of the API.

int aitx2s | ( | PRJX2S_ARGS | ) |  |

aitx2s() deprojects Cartesian coordinates in the plane of a Hammer-Aitoff (`AIT`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int aits2x | ( | PRJS2X_ARGS | ) |  |

aits2x() projects native spherical coordinates to Cartesian coordinates in the plane of a Hammer-Aitoff (`AIT`) projection.

See prjs2x() for a description of the API.

int copset | ( | struct prjprm * | prj) |  |

copset() sets up a prjprm struct for a conic perspective (`COP`) projection.

See prjset() for a description of the API.

int copx2s | ( | PRJX2S_ARGS | ) |  |

copx2s() deprojects Cartesian coordinates in the plane of a conic perspective (`COP`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int cops2x | ( | PRJS2X_ARGS | ) |  |

cops2x() projects native spherical coordinates to Cartesian coordinates in the plane of a conic perspective (`COP`) projection.

See prjs2x() for a description of the API.

int coeset | ( | struct prjprm * | prj) |  |

coeset() sets up a prjprm struct for a conic equal area (`COE`) projection.

See prjset() for a description of the API.

int coex2s | ( | PRJX2S_ARGS | ) |  |

coex2s() deprojects Cartesian coordinates in the plane of a conic equal area (`COE`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int coes2x | ( | PRJS2X_ARGS | ) |  |

coes2x() projects native spherical coordinates to Cartesian coordinates in the plane of a conic equal area (`COE`) projection.

See prjs2x() for a description of the API.

int codset | ( | struct prjprm * | prj) |  |

codset() sets up a prjprm struct for a conic equidistant (`COD`) projection.

See prjset() for a description of the API.

int codx2s | ( | PRJX2S_ARGS | ) |  |

codx2s() deprojects Cartesian coordinates in the plane of a conic equidistant (`COD`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int cods2x | ( | PRJS2X_ARGS | ) |  |

cods2x() projects native spherical coordinates to Cartesian coordinates in the plane of a conic equidistant (`COD`) projection.

See prjs2x() for a description of the API.

int cooset | ( | struct prjprm * | prj) |  |

cooset() sets up a prjprm struct for a conic orthomorphic (`COO`) projection.

See prjset() for a description of the API.

int coox2s | ( | PRJX2S_ARGS | ) |  |

coox2s() deprojects Cartesian coordinates in the plane of a conic orthomorphic (`COO`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int coos2x | ( | PRJS2X_ARGS | ) |  |

coos2x() projects native spherical coordinates to Cartesian coordinates in the plane of a conic orthomorphic (`COO`) projection.

See prjs2x() for a description of the API.

int bonset | ( | struct prjprm * | prj) |  |

bonset() sets up a prjprm struct for a Bonne (`BON`) projection.

See prjset() for a description of the API.

int bonx2s | ( | PRJX2S_ARGS | ) |  |

bonx2s() deprojects Cartesian coordinates in the plane of a Bonne (`BON`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int bons2x | ( | PRJS2X_ARGS | ) |  |

bons2x() projects native spherical coordinates to Cartesian coordinates in the plane of a Bonne (`BON`) projection.

See prjs2x() for a description of the API.

int pcoset | ( | struct prjprm * | prj) |  |

pcoset() sets up a prjprm struct for a polyconic (`PCO`) projection.

See prjset() for a description of the API.

int pcox2s | ( | PRJX2S_ARGS | ) |  |

pcox2s() deprojects Cartesian coordinates in the plane of a polyconic (`PCO`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int pcos2x | ( | PRJS2X_ARGS | ) |  |

pcos2x() projects native spherical coordinates to Cartesian coordinates in the plane of a polyconic (`PCO`) projection.

See prjs2x() for a description of the API.

int tscset | ( | struct prjprm * | prj) |  |

tscset() sets up a prjprm struct for a tangential spherical cube (`TSC`) projection.

See prjset() for a description of the API.

int tscx2s | ( | PRJX2S_ARGS | ) |  |

tscx2s() deprojects Cartesian coordinates in the plane of a tangential spherical cube (`TSC`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int tscs2x | ( | PRJS2X_ARGS | ) |  |

tscs2x() projects native spherical coordinates to Cartesian coordinates in the plane of a tangential spherical cube (`TSC`) projection.

See prjs2x() for a description of the API.

int cscset | ( | struct prjprm * | prj) |  |

cscset() sets up a prjprm struct for a COBE spherical cube (`CSC`) projection.

See prjset() for a description of the API.

int cscx2s | ( | PRJX2S_ARGS | ) |  |

cscx2s() deprojects Cartesian coordinates in the plane of a COBE spherical cube (`CSC`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int cscs2x | ( | PRJS2X_ARGS | ) |  |

cscs2x() projects native spherical coordinates to Cartesian coordinates in the plane of a COBE spherical cube (`CSC`) projection.

See prjs2x() for a description of the API.

int qscset | ( | struct prjprm * | prj) |  |

qscset() sets up a prjprm struct for a quadrilateralized spherical cube (`QSC`) projection.

See prjset() for a description of the API.

int qscx2s | ( | PRJX2S_ARGS | ) |  |

qscx2s() deprojects Cartesian coordinates in the plane of a quadrilateralized spherical cube (`QSC`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int qscs2x | ( | PRJS2X_ARGS | ) |  |

qscs2x() projects native spherical coordinates to Cartesian coordinates in the plane of a quadrilateralized spherical cube (`QSC`) projection.

See prjs2x() for a description of the API.

int hpxset | ( | struct prjprm * | prj) |  |

hpxset() sets up a prjprm struct for a HEALPix (`HPX`) projection.

See prjset() for a description of the API.

int hpxx2s | ( | PRJX2S_ARGS | ) |  |

hpxx2s() deprojects Cartesian coordinates in the plane of a HEALPix (`HPX`) projection to native spherical coordinates .

See prjx2s() for a description of the API.

int hpxs2x | ( | PRJS2X_ARGS | ) |  |

hpxs2x() projects native spherical coordinates to Cartesian coordinates in the plane of a HEALPix (`HPX`) projection.

See prjs2x() for a description of the API.

int xphset | ( | struct prjprm * | prj) |  |

int xphx2s | ( | PRJX2S_ARGS | ) |  |

int xphs2x | ( | PRJS2X_ARGS | ) |  |

## Variable Documentation

const char * prj_errmsg[]

Error messages to match the status value returned from each function.

const int CONIC

Identifier for conic projections, see prjprm::category.

const int CONVENTIONAL

Identifier for conventional projections, see prjprm::category.

const int CYLINDRICAL

Identifier for cylindrical projections, see prjprm::category.

const int POLYCONIC

Identifier for polyconic projections, see prjprm::category.

const int PSEUDOCYLINDRICAL

Identifier for pseudocylindrical projections, see prjprm::category.

const int QUADCUBE

Identifier for quadcube projections, see prjprm::category.

const int ZENITHAL

Identifier for zenithal/azimuthal projections, see prjprm::category.

const int HEALPIX

Identifier for the HEALPix projection, see prjprm::category.

const char prj_categories[9][32]

Names of the projection categories, all in lower-case except for "HEALPix".

Provided for information only, not used by the projection routines.

const int prj_ncode

The number of recognized three-letter projection codes (currently 27), see prj_codes.

const char prj_codes[27][4]

List of all recognized three-letter projection codes (currently 27), e.g. `SIN`, `TAN`, etc.