# linprm Struct Reference

Linear transformation parameters. More...

`#include <lin.h>`

## Data Fields
int | flag
int | naxis
double * | crpix
double * | pc
double * | cdelt
double * | piximg
double * | imgpix
int | unity
int | padding
struct wcserr * | err
int | i_naxis
int | m_flag
int | m_naxis
int | m_padding
double * | m_crpix
double * | m_pc
double * | m_cdelt
void * | padding2

## Detailed Description

The linprm struct contains all of the information required to perform a linear transformation. It consists of certain members that must be set by the user (given) and others that are set by the WCSLIB routines (returned).

## Field Documentation

int linprm::flag

(Given and returned) This flag must be set to zero whenever any of the following members of the linprm struct are set or modified:

- linprm::naxis (q.v., not normally set by the user),
- linprm::pc,
- linprm::cdelt.

This signals the initialization routine, linset(), to recompute the returned members of the linprm struct. linset() will reset flag to indicate that this has been done.

PLEASE NOTE: flag should be set to -1 when linini() is called for the first time for a particular linprm struct in order to initialize memory management. It must ONLY be used on the first initialization otherwise memory leaks may result.

int linprm::naxis

(Given or returned) Number of pixel and world coordinate elements.

If linini() is used to initialize the linprm struct (as would normally be the case) then it will set naxis from the value passed to it as a function argument. The user should not subsequently modify it.

double * linprm::crpix

(Given) Pointer to the first element of an array of double containing the coordinate reference pixel, `CRPIXja`.

double * linprm::pc

(Given) Pointer to the first element of the `PCi_ja` (pixel coordinate) transformation matrix. The expected order is

            struct linprm lin;
            lin.pc = {PC1_1, PC1_2, PC2_1, PC2_2};

This may be constructed conveniently from a 2-D array via

            double m[2][2] = {{PC1_1, PC1_2},
                              {PC2_1, PC2_2}};

which is equivalent to

            double m[2][2];
            m[0][0] = PC1_1;
            m[0][1] = PC1_2;
            m[1][0] = PC2_1;
            m[1][1] = PC2_2;

The storage order for this 2-D array is the same as for the 1-D array, whence

            lin.pc = *m;

would be legitimate.

double * linprm::cdelt

(Given) Pointer to the first element of an array of double containing the coordinate increments, `CDELTia`.

double * linprm::piximg

(Returned) Pointer to the first element of the matrix containing the product of the `CDELTia` diagonal matrix and the `PCi_ja` matrix.

double * linprm::imgpix

(Returned) Pointer to the first element of the inverse of the linprm::piximg matrix.

int linprm::unity

(Returned) True if the linear transformation matrix is unity.

int linprm::padding

(An unused variable inserted for alignment purposes only.)

struct wcserr * linprm::err`[read]`

(Returned) If enabled, when an error status is returned this struct contains detailed information about the error, see wcserr_enable().

int linprm::i_naxis

(For internal use only.)

int linprm::m_flag

(For internal use only.)

int linprm::m_naxis

(For internal use only.)

int linprm::m_padding

(For internal use only.)

double * linprm::m_crpix

(For internal use only.)

double * linprm::m_pc

(For internal use only.)

double * linprm::m_cdelt

(For internal use only.) void *padding2 (For internal use only.)

void* linprm::padding2