Changeset 3714 for trunk/psLib/src
- Timestamp:
- Apr 18, 2005, 6:16:02 PM (21 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 7 edited
-
astro/psCoord.c (modified) (4 diffs)
-
astronomy/psCoord.c (modified) (4 diffs)
-
dataManip/psFunctions.c (modified) (2 diffs)
-
image/psImageStats.c (modified) (2 diffs)
-
imageops/psImageStats.c (modified) (2 diffs)
-
math/psPolynomial.c (modified) (2 diffs)
-
math/psSpline.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r3711 r3714 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.6 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-04-19 0 1:22:59$12 * @version $Revision: 1.64 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-04-19 04:16:02 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 84 84 X1 = (-D + ((F*A)/C)) / (E - ((F*B)/C)) + 85 85 (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)))); 90 90 91 91 XXX: Since thre is now a general psPlaneTransformInvert() function, we 92 92 should rename this. 93 94 X1, Y1 = (2, 3) 95 96 X2 = 1 + 4 + 9 = 14 97 Y2 = 4 + 10 + 18 = 32 98 99 in inverse 100 101 Y1 = (32 - ((5/2) * 14) - 4 + ((5)/2)) / (6 - ((15)/2)); 102 Y1 = (32 - 35 - 4 + (5/2)) / (6 - 15/2); 103 Y1 = (-7 + (5/2)) / (12/2 - 15/2); 104 Y1 = (-7 + (5/2)) / (-3/2); 105 Y1 = (-14/2 + 5/2) / (-3/2); 106 Y1 = (-9/2) / (-3/2); 107 Y1 = (9/2) / (3/2); 108 Y1 = 3 109 110 X1 = (Y2 - ((F/C) * X2) - D + ((F*A)/C)) / (E - ((F*B)/C)); 111 X1 = (32 - ((6/3) * 14) - 4 + ((6)/3)) / (5 - ((12)/3)); 112 X1 = (32 - (2 * 14) - 4 + 2 / (5 - 4); 113 X1 = (32 - 28 - 4 + 2) / 1; 114 X1 = 2; 93 115 94 116 *****************************************************************************/ … … 125 147 psPlaneTransform *out = psPlaneTransformAlloc(2, 2); 126 148 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)); 128 150 out->x->coeff[1][0] = -(F/C) / (E - ((F*B)/C)); 129 151 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)); 131 153 out->y->coeff[1][0] = -(E/B) / (F - ((C*E)/B)); 132 154 out->y->coeff[0][1] = 1.0 / (F - ((C*E)/B)); … … 1140 1162 // 1141 1163 if (p_psIsProjectionLinear((psPlaneTransform *) in)) { 1142 printf("COOL: is linear\n");1143 1164 return(p_psPlaneTransformLinearInvert((psPlaneTransform *) in)); 1144 1165 } -
trunk/psLib/src/astronomy/psCoord.c
r3711 r3714 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.6 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-04-19 0 1:22:59$12 * @version $Revision: 1.64 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-04-19 04:16:02 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 84 84 X1 = (-D + ((F*A)/C)) / (E - ((F*B)/C)) + 85 85 (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)))); 90 90 91 91 XXX: Since thre is now a general psPlaneTransformInvert() function, we 92 92 should rename this. 93 94 X1, Y1 = (2, 3) 95 96 X2 = 1 + 4 + 9 = 14 97 Y2 = 4 + 10 + 18 = 32 98 99 in inverse 100 101 Y1 = (32 - ((5/2) * 14) - 4 + ((5)/2)) / (6 - ((15)/2)); 102 Y1 = (32 - 35 - 4 + (5/2)) / (6 - 15/2); 103 Y1 = (-7 + (5/2)) / (12/2 - 15/2); 104 Y1 = (-7 + (5/2)) / (-3/2); 105 Y1 = (-14/2 + 5/2) / (-3/2); 106 Y1 = (-9/2) / (-3/2); 107 Y1 = (9/2) / (3/2); 108 Y1 = 3 109 110 X1 = (Y2 - ((F/C) * X2) - D + ((F*A)/C)) / (E - ((F*B)/C)); 111 X1 = (32 - ((6/3) * 14) - 4 + ((6)/3)) / (5 - ((12)/3)); 112 X1 = (32 - (2 * 14) - 4 + 2 / (5 - 4); 113 X1 = (32 - 28 - 4 + 2) / 1; 114 X1 = 2; 93 115 94 116 *****************************************************************************/ … … 125 147 psPlaneTransform *out = psPlaneTransformAlloc(2, 2); 126 148 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)); 128 150 out->x->coeff[1][0] = -(F/C) / (E - ((F*B)/C)); 129 151 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)); 131 153 out->y->coeff[1][0] = -(E/B) / (F - ((C*E)/B)); 132 154 out->y->coeff[0][1] = 1.0 / (F - ((C*E)/B)); … … 1140 1162 // 1141 1163 if (p_psIsProjectionLinear((psPlaneTransform *) in)) { 1142 printf("COOL: is linear\n");1143 1164 return(p_psPlaneTransformLinearInvert((psPlaneTransform *) in)); 1144 1165 } -
trunk/psLib/src/dataManip/psFunctions.c
r3709 r3714 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.9 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-04-19 0 0:34:04$9 * @version $Revision: 1.98 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-04-19 04:16:02 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 13 13 * 14 * XXX: What happens if the polyE Val functions are called with data of the wrong14 * XXX: What happens if the polyEval functions are called with data of the wrong 15 15 * type? 16 16 * XXX: Should the "coeffErr[]" be used as well? Bug ???. Ignore coeffErr 17 17 * 18 * XXX: In the various polyAlloc(n) functions, n is really the order of the 19 * polynomial plus 1. To create a 2nd-order polynomial, n == 3. 18 20 */ 19 21 /*****************************************************************************/ … … 175 177 static void dPolynomial2DFree(psDPolynomial2D* myPoly) 176 178 { 177 psS32 x = 0;178 179 for ( x = 0; x < myPoly->nX; x++) {179 //printf("dPolynomial2DFree(): HMMM: myPoly->nX is %d\n", myPoly->nX); 180 //printf("dPolynomial2DFree(): HMMM: myPoly->nY is %d\n", myPoly->nY); 181 for (psS32 x = 0; x < myPoly->nX; x++) { 180 182 psFree(myPoly->coeff[x]); 181 183 psFree(myPoly->coeffErr[x]); -
trunk/psLib/src/image/psImageStats.c
r3684 r3714 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.7 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-04- 08 17:58:57$11 * @version $Revision: 1.72 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-04-19 04:16:02 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 40 40 41 41 XXX: use static psVectors 42 43 XXX: optimize this. 2k vs 4k, sample mean, takes8 seconds on Gene's machine. 44 Should take .2. 42 45 *****************************************************************************/ 43 46 psStats* psImageStats(psStats* stats, -
trunk/psLib/src/imageops/psImageStats.c
r3684 r3714 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.7 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-04- 08 17:58:57$11 * @version $Revision: 1.72 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-04-19 04:16:02 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 40 40 41 41 XXX: use static psVectors 42 43 XXX: optimize this. 2k vs 4k, sample mean, takes8 seconds on Gene's machine. 44 Should take .2. 42 45 *****************************************************************************/ 43 46 psStats* psImageStats(psStats* stats, -
trunk/psLib/src/math/psPolynomial.c
r3709 r3714 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.9 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-04-19 0 0:34:04$9 * @version $Revision: 1.98 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-04-19 04:16:02 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 13 13 * 14 * XXX: What happens if the polyE Val functions are called with data of the wrong14 * XXX: What happens if the polyEval functions are called with data of the wrong 15 15 * type? 16 16 * XXX: Should the "coeffErr[]" be used as well? Bug ???. Ignore coeffErr 17 17 * 18 * XXX: In the various polyAlloc(n) functions, n is really the order of the 19 * polynomial plus 1. To create a 2nd-order polynomial, n == 3. 18 20 */ 19 21 /*****************************************************************************/ … … 175 177 static void dPolynomial2DFree(psDPolynomial2D* myPoly) 176 178 { 177 psS32 x = 0;178 179 for ( x = 0; x < myPoly->nX; x++) {179 //printf("dPolynomial2DFree(): HMMM: myPoly->nX is %d\n", myPoly->nX); 180 //printf("dPolynomial2DFree(): HMMM: myPoly->nY is %d\n", myPoly->nY); 181 for (psS32 x = 0; x < myPoly->nX; x++) { 180 182 psFree(myPoly->coeff[x]); 181 183 psFree(myPoly->coeffErr[x]); -
trunk/psLib/src/math/psSpline.c
r3709 r3714 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.9 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-04-19 0 0:34:04$9 * @version $Revision: 1.98 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-04-19 04:16:02 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 13 13 * 14 * XXX: What happens if the polyE Val functions are called with data of the wrong14 * XXX: What happens if the polyEval functions are called with data of the wrong 15 15 * type? 16 16 * XXX: Should the "coeffErr[]" be used as well? Bug ???. Ignore coeffErr 17 17 * 18 * XXX: In the various polyAlloc(n) functions, n is really the order of the 19 * polynomial plus 1. To create a 2nd-order polynomial, n == 3. 18 20 */ 19 21 /*****************************************************************************/ … … 175 177 static void dPolynomial2DFree(psDPolynomial2D* myPoly) 176 178 { 177 psS32 x = 0;178 179 for ( x = 0; x < myPoly->nX; x++) {179 //printf("dPolynomial2DFree(): HMMM: myPoly->nX is %d\n", myPoly->nX); 180 //printf("dPolynomial2DFree(): HMMM: myPoly->nY is %d\n", myPoly->nY); 181 for (psS32 x = 0; x < myPoly->nX; x++) { 180 182 psFree(myPoly->coeff[x]); 181 183 psFree(myPoly->coeffErr[x]);
Note:
See TracChangeset
for help on using the changeset viewer.
