IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 18, 2005, 6:16:02 PM (21 years ago)
Author:
gusciora
Message:

Created tests for inverting linear psPlaneTransforms. Fixed a bug with the
linear transform inversion code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astronomy/psCoord.c

    r3711 r3714  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.63 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-04-19 01:22:59 $
     12*  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-04-19 04:16:02 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    8484 X1 = (-D + ((F*A)/C)) / (E - ((F*B)/C)) +
    8585      (X2 * -((F/C) / (E - ((F*B)/C)))) +
    86              (Y2 * (1.0 / (E - ((F*B)/C))));
    87         Y1 = (-D + ((E*A)/B))/(F - ((C*E)/B)) +
    88              (X2 * -((E/B) / (F - ((C*E)/B)))) +
    89              (Y2 * (1.0 / (F - ((C*E)/B))));
     86      (Y2 * (1.0 / (E - ((F*B)/C))));
     87 Y1 = (-D + ((E*A)/B))/(F - ((C*E)/B)) +
     88      (X2 * -((E/B) / (F - ((C*E)/B)))) +
     89      (Y2 * (1.0 / (F - ((C*E)/B))));
    9090 
    9191XXX: Since thre is now a general psPlaneTransformInvert() function, we
    9292should rename this.
     93 
     94X1, Y1 = (2, 3)
     95 
     96    X2 = 1 + 4 + 9   = 14
     97    Y2 = 4 + 10 + 18 = 32
     98 
     99in inverse
     100 
     101Y1 = (32 - ((5/2) * 14) - 4 + ((5)/2)) / (6 - ((15)/2));
     102Y1 = (32 - 35 - 4 + (5/2)) / (6 - 15/2);
     103Y1 = (-7 + (5/2)) / (12/2 - 15/2);
     104Y1 = (-7 + (5/2)) / (-3/2);
     105Y1 = (-14/2 + 5/2) / (-3/2);
     106Y1 = (-9/2) / (-3/2);
     107Y1 = (9/2) / (3/2);
     108Y1 = 3
     109 
     110X1 = (Y2 - ((F/C) * X2) - D + ((F*A)/C)) / (E - ((F*B)/C));
     111X1 = (32 - ((6/3) * 14) - 4 + ((6)/3)) / (5 - ((12)/3));
     112X1 = (32 - (2 * 14) - 4 + 2 / (5 - 4);
     113X1 = (32 - 28 - 4 + 2) / 1;
     114X1 = 2;
    93115 
    94116 *****************************************************************************/
     
    125147    psPlaneTransform *out = psPlaneTransformAlloc(2, 2);
    126148
    127     out->x->coeff[0][0] = -D + ((F*A)/C) / (E - ((F*B)/C));
     149    out->x->coeff[0][0] = (-D + ((F*A)/C)) / (E - ((F*B)/C));
    128150    out->x->coeff[1][0] = -(F/C) / (E - ((F*B)/C));
    129151    out->x->coeff[0][1] =  1.0 / (E - ((F*B)/C));
    130     out->y->coeff[0][0] = -D + ((E*A)/B) / (F - ((C*E)/B));
     152    out->y->coeff[0][0] = (-D + ((E*A)/B)) / (F - ((C*E)/B));
    131153    out->y->coeff[1][0] = -(E/B) / (F - ((C*E)/B));
    132154    out->y->coeff[0][1] =  1.0 / (F - ((C*E)/B));
     
    11401162    //
    11411163    if (p_psIsProjectionLinear((psPlaneTransform *) in)) {
    1142         printf("COOL: is linear\n");
    11431164        return(p_psPlaneTransformLinearInvert((psPlaneTransform *) in));
    11441165    }
Note: See TracChangeset for help on using the changeset viewer.