Changeset 3f832f9 in sasmodels
- Timestamp:
- Jan 7, 2016 11:46:36 AM (9 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- a7f909a
- Parents:
- 3c97ff0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/ellipsoid.c
rd53d3cd r3f832f9 4 4 double rpolar, double requatorial, double theta, double phi); 5 5 6 double _ellipsoid_kernel(double q, double rpolar, double requatorial, double cos_alpha);7 double _ellipsoid_kernel(double q, double rpolar, double requatorial, double cos_alpha)6 double _ellipsoid_kernel(double q, double rpolar, double requatorial, double sin_alpha); 7 double _ellipsoid_kernel(double q, double rpolar, double requatorial, double sin_alpha) 8 8 { 9 9 double sn, cn; 10 10 double ratio = rpolar/requatorial; 11 11 const double u = q*requatorial*sqrt(1.0 12 + cos_alpha*cos_alpha*(ratio*ratio - 1.0));12 + sin_alpha*sin_alpha*(ratio*ratio - 1.0)); 13 13 SINCOS(u, sn, cn); 14 14 //const double f = ( u==0.0 ? 1.0 : 3.0*(sn-u*cn)/(u*u*u) ); … … 35 35 double total = 0.0; 36 36 for (int i=0;i<76;i++) { 37 //const double cos_alpha = (Gauss76Z[i]*(upper-lower) + upper + lower)/2;38 const double cos_alpha = 0.5*(Gauss76Z[i] + 1.0);39 total += Gauss76Wt[i] * _ellipsoid_kernel(q, rpolar, requatorial, cos_alpha);37 //const double sin_alpha = (Gauss76Z[i]*(upper-lower) + upper + lower)/2; 38 const double sin_alpha = 0.5*(Gauss76Z[i] + 1.0); 39 total += Gauss76Wt[i] * _ellipsoid_kernel(q, rpolar, requatorial, sin_alpha); 40 40 } 41 41 //const double form = (upper-lower)/2*total; … … 57 57 const double q = sqrt(qx*qx + qy*qy); 58 58 SINCOS(theta*M_PI_180, sn, cn); 59 // TODO: check if this is actually sin(alpha), not cos(alpha) 59 60 const double cos_alpha = cn*cos(phi*M_PI_180)*(qx/q) + sn*(qy/q); 60 61 const double form = _ellipsoid_kernel(q, rpolar, requatorial, cos_alpha);
Note: See TracChangeset
for help on using the changeset viewer.