Changeset b966a96 in sasmodels for sasmodels/kernel_iq.c
- Timestamp:
- Jul 21, 2016 3:12:18 PM (8 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:
- 6a0d6aa
- Parents:
- 32e3c9b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernel_iq.c
r32e3c9b rb966a96 29 29 30 30 typedef struct { 31 PARAMETER_TABLE ;31 PARAMETER_TABLE 32 32 } ParameterBlock; 33 33 #endif … … 41 41 static double clip(double value, double low, double high) 42 42 { 43 43 return (value < low ? low : (value > high ? high : value)); 44 44 } 45 45 … … 53 53 double *uu, double *dd, double *ud, double *du) 54 54 { 55 56 57 58 59 60 55 in_spin = clip(in_spin, 0.0, 1.0); 56 out_spin = clip(out_spin, 0.0, 1.0); 57 *uu = sqrt(sqrt(in_spin * out_spin)); 58 *dd = sqrt(sqrt((1.0-in_spin) * (1.0-out_spin))); 59 *ud = sqrt(sqrt(in_spin * (1.0-out_spin))); 60 *du = sqrt(sqrt((1.0-in_spin) * out_spin)); 61 61 } 62 62 63 63 // Convert polar to rectangular coordinates. 64 64 static void polrec(double r, double theta, double phi, 65 65 double *x, double *y, double *z) 66 66 { 67 68 69 70 71 72 67 double cos_theta, sin_theta, cos_phi, sin_phi; 68 SINCOS(theta*M_PI_180, sin_theta, cos_theta); 69 SINCOS(phi*M_PI_180, sin_phi, cos_phi); 70 *x = r * cos_theta * cos_phi; 71 *y = r * sin_theta; 72 *z = -r * cos_theta * sin_phi; 73 73 } 74 74 #endif
Note: See TracChangeset
for help on using the changeset viewer.