IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4957


Ignore:
Timestamp:
Sep 7, 2005, 11:33:48 AM (21 years ago)
Author:
gusciora
Message:

psPlaneTransformDeriv()

Location:
trunk/psLib/src/astro
Files:
2 edited

Legend:

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

    r4898 r4957  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.84 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-08-30 01:14:10 $
     12*  @version $Revision: 1.85 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-09-07 21:33:48 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7373XXX: Since there is now a general psPlaneTransformInvert() function, we
    7474should rename this.
     75 
     76XXX: Use the ADD version which is based on determinants.
    7577 *****************************************************************************/
    7678psPlaneTransform *p_psPlaneTransformLinearInvert(psPlaneTransform *transform)
     
    897899}
    898900
     901psPlane *psPlaneTransformDeriv(
     902    psPlane *out,
     903    const psPlaneTransform *transformation,
     904    const psPlane *coord
     905)
     906{
     907    /*
     908        PS_ASSERT_PTR_NON_NULL(transformation, NULL);
     909        PS_ASSERT_POLY_NON_NULL(transformation->x, NULL);
     910        PS_ASSERT_POLY_NON_NULL(transformation->y, NULL);
     911        PS_ASSERT_PTR_NON_NULL(coord, NULL);
     912     
     913        if (out == NULL) {
     914            out = psPlaneAlloc();
     915        }
     916     
     917        out->x = 0.0;
     918        out->y = 0.0;
     919        out->xErr = 0.0;
     920        out->yErr = 0.0;
     921     
     922        psPolynomial2D *xPoly = transformation->x;
     923        psPolynomial2D *yPoly = transformation->y;
     924     
     925        //
     926        // Calculate the derivative with respect to x.
     927        //
     928        psF32 xSum = 1.0;
     929        psF32 ySum = 1.0;
     930     
     931        // This loop starts at loop_x=1 since the derivative of the loop_x=0 terms are all 0.0
     932        for (psS32 loop_x = 1; loop_x < xPoly->nX; loop_x++) {
     933            ySum = 1.0;
     934            for (psS32 loop_y = 0; loop_y < xPoly->nY; loop_y++) {
     935                //
     936                // For each iteration of the loop, we multiple the (x, y) coefficient
     937                // by (coord->x^(loop_x-1) * coord->y^loop_y)
     938                //
     939     
     940                out->x+= xPoly->coeff[loop_x][loop_y] * xSum * ySum;
     941                ySum*= coord->y;
     942            }
     943            xSum*= coord->x;
     944        }
     945     
     946        //
     947        // Calculate the derivative with respect to x.
     948        //
     949        xSum = 1.0;
     950     
     951        // This loop starts at loop_y=1 since the derivative of the loop_y=0 terms are all 0.0
     952        for (psS32 loop_x = 0; loop_x < yPoly->nX; loop_x++) {
     953            ySum = 1.0;
     954            for (psS32 loop_y = 1; loop_y < yPoly->nY; loop_y++) {
     955                //
     956                // For each iteration of the loop, we multiple the (x, y) coefficient
     957                // by (coord->x^(loop_x-1) * coord->y^loop_y)
     958                //
     959     
     960                out->y+= yPoly->coeff[loop_x][loop_y] * xSum * ySum;
     961                ySum*= coord->y;
     962            }
     963            xSum*= coord->x;
     964        }
     965    */
     966    return(out);
     967}
     968
    899969psCube *psSphereToCube(const psSphere *sphere)
    900970{
  • trunk/psLib/src/astro/psCoord.h

    r4937 r4957  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-08-31 22:28:35 $
     12*  @version $Revision: 1.44 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-09-07 21:33:48 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    404404
    405405
     406/** Calculates the derivative of the specified psPlaneTransform with respect to x and y.
     407 *
     408 *  @return psPlane*         The derivative.
     409 */
     410psPlane *psPlaneTransformDeriv(
     411    psPlane *out,
     412    const psPlaneTransform *transformation,
     413    const psPlane *coord
     414);
     415
    406416/// @}
    407417
Note: See TracChangeset for help on using the changeset viewer.