Changeset 6254
- Timestamp:
- Jan 30, 2006, 1:42:24 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astro/psCoord.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r6253 r6254 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.10 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-01-30 2 2:56:01$12 * @version $Revision: 1.105 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-01-30 23:42:24 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 206 206 207 207 // XXX: Verify the order/nterms poly changes 208 psPlaneTransform* psPlaneTransformAlloc(int order1, 209 int order2) 208 psPlaneTransform* psPlaneTransformAlloc(int order1, int order2) 210 209 { 211 210 PS_ASSERT_INT_NONNEGATIVE(order1, NULL); … … 241 240 } 242 241 243 psPlane* psPlaneTransformApply(psPlane* out, 244 const psPlaneTransform* transform, 245 const psPlane* coords) 242 psPlane* psPlaneTransformApply( 243 psPlane* out, 244 const psPlaneTransform* transform, 245 const psPlane* coords) 246 246 { 247 247 PS_ASSERT_PTR_NON_NULL(transform, NULL); … … 267 267 268 268 // XXX: Verify the order/nterms poly changes 269 psPlaneDistort* psPlaneDistortAlloc(int order1, 270 int order2, 271 int order3, 272 int order4) 269 psPlaneDistort* psPlaneDistortAlloc(int order1, int order2, int order3, int order4) 273 270 { 274 271 PS_ASSERT_INT_NONNEGATIVE(order1, NULL); … … 350 347 } 351 348 352 psProjection* psProjectionAlloc(double R, 353 double D, 354 double Xs, 355 double Ys, 356 psProjectionType type) 349 psProjection* psProjectionAlloc( 350 double R, 351 double D, 352 double Xs, 353 double Ys, 354 psProjectionType type) 357 355 { 358 356 psProjection *p = psAlloc(sizeof(psProjection)); … … 374 372 375 373 376 psPlane* p_psProject(psPlane *outPlane, 377 const psSphere* coord, 378 const psProjection* projection) 374 psPlane* p_psProject( 375 psPlane *outPlane, 376 const psSphere* coord, 377 const psProjection* projection) 379 378 { 380 379 PS_ASSERT_PTR_NON_NULL(coord, NULL); … … 458 457 } 459 458 460 psSphere* p_psDeproject(psSphere *outSphere, 461 const psPlane* coord, 462 const psProjection* projection) 459 psSphere* p_psDeproject( 460 psSphere *outSphere, 461 const psPlane* coord, 462 const psProjection* projection) 463 463 { 464 464 PS_ASSERT_PTR_NON_NULL(coord, NULL); … … 604 604 routine far too many times. 605 605 *****************************************************************************/ 606 psPlaneTransform *psPlaneTransformCombine(psPlaneTransform *out, 607 const psPlaneTransform *trans1, 608 const psPlaneTransform *trans2, 609 psRegion region, 610 int nSamples) 606 psPlaneTransform *psPlaneTransformCombine( 607 psPlaneTransform *out, 608 const psPlaneTransform *trans1, 609 const psPlaneTransform *trans2, 610 psRegion region, 611 int nSamples) 611 612 { 612 613 psTrace(__func__, 3, "---- %s() begin ----\n", __func__); … … 1015 1016 } 1016 1017 1017 psPlane *psPlaneTransformDeriv(psPlane *out, 1018 const psPlaneTransform *transformation, 1019 const psPlane *coord) 1018 psPlane *psPlaneTransformDeriv( 1019 psPlane *out, 1020 const psPlaneTransform *transformation, 1021 const psPlane *coord 1022 ) 1020 1023 { 1021 1024 PS_ASSERT_PTR_NON_NULL(transformation, NULL); … … 1047 1050 for (psS32 loop_y = 0; loop_y < (1 + xPoly->nY); loop_y++) { 1048 1051 // 1049 // For each iteration of the loop, we multipl ethe (x, y) coefficient1050 // by ( coord->x^(loop_x-1) * coord->y^loop_y)1052 // For each iteration of the loop, we multiply the (x, y) coefficient 1053 // by (x^(loop_x-1) * y^loop_y) * loop_x 1051 1054 // 1052 1055 1053 out->x+= xPoly->coeff[loop_x][loop_y] * xSum * ySum; 1056 out->x+= xPoly->coeff[loop_x][loop_y] * xSum * ySum * ((psF32) loop_x); 1057 psTrace(__func__, 6, "out->x+= (%.2f * %.2f * %.2f * %.2f)\n", xPoly->coeff[loop_x][loop_y], xSum, ySum, ((psF32) loop_x)); 1054 1058 ySum*= coord->y; 1055 1059 } … … 1067 1071 for (psS32 loop_y = 1; loop_y < (1 + yPoly->nY); loop_y++) { 1068 1072 // 1069 // For each iteration of the loop, we multiple the (x, y) coefficient 1070 // by (coord->x^(loop_x-1) * coord->y^loop_y) 1073 // For each iteration of the loop, we multiply the (x, y) coefficient 1074 // by (x^(loop_x-1) * y^loop_y) * loop_y 1075 // by (x^(loop_x) * y^(loop_y-1)) 1071 1076 // 1072 1077 1073 out->y+= yPoly->coeff[loop_x][loop_y] * xSum * ySum; 1078 out->y+= yPoly->coeff[loop_x][loop_y] * xSum * ySum * ((psF32) loop_y); 1079 psTrace(__func__, 6, "out->y+= (%.2f * %.2f * %.2f * %.2f)\n", yPoly->coeff[loop_x][loop_y], xSum, ySum, ((psF32) loop_y)); 1074 1080 ySum*= coord->y; 1075 1081 } 1076 1082 xSum*= coord->x; 1077 1083 } 1084 1078 1085 return(out); 1079 1086 }
Note:
See TracChangeset
for help on using the changeset viewer.
