Changeset 2bb0b26 in sasview for realSpaceModeling/pointsmodelpy/libpointsmodelpy/points_model.cc
- Timestamp:
- Sep 27, 2007 11:16:55 AM (17 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 02cb31a
- Parents:
- d1101bb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
realSpaceModeling/pointsmodelpy/libpointsmodelpy/points_model.cc
rf2d6445 r2bb0b26 375 375 return I; 376 376 } 377 378 /* 379 * 2D simulation for oriented systems 380 * The beam direction is assumed to be in the z direction. 381 * 382 * @param points: vector of space points 383 * @param qx: qx [A-1] 384 * @param qy: qy [A-1] 385 * @return: I(qx, qy) for the system described by the space points [cm-1] 386 * 387 */ 388 double PointsModel::CalculateIQ_2D(const vector<Point3D>&points, double qx, double qy){ 389 /* 390 * TODO: the vector of points should really be part of the class 391 * This is a design flaw inherited from the original programmer. 392 */ 393 394 int size = points.size(); 395 396 double cos_term = 0; 397 double sin_term = 0; 398 for (int i = 0; i < size; i++) { 399 //the sld for the pair of points 400 401 double phase = qx*points[i].getX() + qy*points[i].getY(); 402 403 cos_term += cos(phase) * points[i].getSLD(); 404 sin_term += sin(phase) * points[i].getSLD(); 405 406 } 407 408 // P(q) = 1/V I(q) = (V/N)^2 (1/V) (cos_term^2 + sin_term^2) 409 // We divide by N here and we will multiply by the density later. 410 411 return (cos_term*cos_term + sin_term*sin_term)/size; 412 } 413
Note: See TracChangeset
for help on using the changeset viewer.