| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | /* | 
| 2 |  |  |  |  |  |  | *+ | 
| 3 |  |  |  |  |  |  | *  Name: | 
| 4 |  |  |  |  |  |  | *     palXy2xy | 
| 5 |  |  |  |  |  |  |  | 
| 6 |  |  |  |  |  |  | *  Purpose: | 
| 7 |  |  |  |  |  |  | *     Transform one [x,y] into another using a linear model of the type | 
| 8 |  |  |  |  |  |  | *     produced by the palFitxy routine. | 
| 9 |  |  |  |  |  |  |  | 
| 10 |  |  |  |  |  |  | *  Language: | 
| 11 |  |  |  |  |  |  | *     Starlink ANSI C | 
| 12 |  |  |  |  |  |  |  | 
| 13 |  |  |  |  |  |  | *  Type of Module: | 
| 14 |  |  |  |  |  |  | *     Library routine | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | *  Invocation: | 
| 17 |  |  |  |  |  |  | *     palXy2xy ( double x1, double y1, double coeffs[6], | 
| 18 |  |  |  |  |  |  | *                double *x2, double *y2) | 
| 19 |  |  |  |  |  |  |  | 
| 20 |  |  |  |  |  |  | *  Arguments: | 
| 21 |  |  |  |  |  |  | *     x1 = double (Given) | 
| 22 |  |  |  |  |  |  | *        x-coordinate | 
| 23 |  |  |  |  |  |  | *     y1 = double (Given) | 
| 24 |  |  |  |  |  |  | *        y-coordinate | 
| 25 |  |  |  |  |  |  | *     coeffs = double[6] (Given) | 
| 26 |  |  |  |  |  |  | *        transformation coefficients (see note) | 
| 27 |  |  |  |  |  |  | *     x2 = double (Returned) | 
| 28 |  |  |  |  |  |  | *        x-coordinate | 
| 29 |  |  |  |  |  |  | *     y2 = double (Returned) | 
| 30 |  |  |  |  |  |  | *        y-coordinate | 
| 31 |  |  |  |  |  |  |  | 
| 32 |  |  |  |  |  |  | *  Description: | 
| 33 |  |  |  |  |  |  | *     The model relates two sets of [x,y] coordinates as follows. | 
| 34 |  |  |  |  |  |  | *     Naming the elements of coeffs: | 
| 35 |  |  |  |  |  |  | *     --- | 
| 36 |  |  |  |  |  |  | *        coeffs[0] = A | 
| 37 |  |  |  |  |  |  | *        coeffs[1] = B | 
| 38 |  |  |  |  |  |  | *        coeffs[2] = C | 
| 39 |  |  |  |  |  |  | *        coeffs[3] = D | 
| 40 |  |  |  |  |  |  | *        coeffs[4] = E | 
| 41 |  |  |  |  |  |  | *        coeffs[5] = F | 
| 42 |  |  |  |  |  |  | *     --- | 
| 43 |  |  |  |  |  |  | *     the present routine performs the transformation: | 
| 44 |  |  |  |  |  |  | *     --- | 
| 45 |  |  |  |  |  |  | *        x2 = A + B * x1 + C * y1 | 
| 46 |  |  |  |  |  |  | *        y2 = D + E * x1 + F * y1 | 
| 47 |  |  |  |  |  |  | *     --- | 
| 48 |  |  |  |  |  |  |  | 
| 49 |  |  |  |  |  |  | *  See also: | 
| 50 |  |  |  |  |  |  | *     palFitxy, palPxy, palInvf and palDcmpf | 
| 51 |  |  |  |  |  |  |  | 
| 52 |  |  |  |  |  |  | *  Authors: | 
| 53 |  |  |  |  |  |  | *     PTW: Pat Wallace (STFC) | 
| 54 |  |  |  |  |  |  | *     GSB: Graham Bell (EAO) | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  | *  History: | 
| 57 |  |  |  |  |  |  | *     1994-12-05 (PTW): | 
| 58 |  |  |  |  |  |  | *        SLALIB implementation. | 
| 59 |  |  |  |  |  |  | *     2018-10-23 (GSB): | 
| 60 |  |  |  |  |  |  | *        Initial version in C. | 
| 61 |  |  |  |  |  |  |  | 
| 62 |  |  |  |  |  |  | *  Copyright: | 
| 63 |  |  |  |  |  |  | *     Copyright (C) 1995 Rutherford Appleton Laboratory | 
| 64 |  |  |  |  |  |  | *     Copyright (C) 2018 East Asian Observatory. | 
| 65 |  |  |  |  |  |  |  | 
| 66 |  |  |  |  |  |  | *  Licence: | 
| 67 |  |  |  |  |  |  | *     This program is free software; you can redistribute it and/or modify | 
| 68 |  |  |  |  |  |  | *     it under the terms of the GNU General Public License as published by | 
| 69 |  |  |  |  |  |  | *     the Free Software Foundation; either version 2 of the License, or | 
| 70 |  |  |  |  |  |  | *     (at your option) any later version. | 
| 71 |  |  |  |  |  |  | * | 
| 72 |  |  |  |  |  |  | *     This program is distributed in the hope that it will be useful, | 
| 73 |  |  |  |  |  |  | *     but WITHOUT ANY WARRANTY; without even the implied warranty of | 
| 74 |  |  |  |  |  |  | *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
| 75 |  |  |  |  |  |  | *     GNU General Public License for more details. | 
| 76 |  |  |  |  |  |  | * | 
| 77 |  |  |  |  |  |  | *     You should have received a copy of the GNU General Public License | 
| 78 |  |  |  |  |  |  | *     along with this program (see SLA_CONDITIONS); if not, write to the | 
| 79 |  |  |  |  |  |  | *     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 
| 80 |  |  |  |  |  |  | *     Boston, MA  02110-1301  USA | 
| 81 |  |  |  |  |  |  | *- | 
| 82 |  |  |  |  |  |  | */ | 
| 83 |  |  |  |  |  |  |  | 
| 84 | 9 |  |  |  |  |  | void palXy2xy ( double x1, double y1, double coeffs[6], | 
| 85 |  |  |  |  |  |  | double *x2, double *y2 ) { | 
| 86 |  |  |  |  |  |  |  | 
| 87 | 9 |  |  |  |  |  | *x2 = coeffs[0] + coeffs[1] * x1 + coeffs[2] * y1; | 
| 88 | 9 |  |  |  |  |  | *y2 = coeffs[3] + coeffs[4] * x1 + coeffs[5] * y1; | 
| 89 | 9 |  |  |  |  |  | } |