Changeset 218cdbc in sasmodels
- Timestamp:
- Oct 17, 2016 11:11:17 AM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 1b49bf8
- Parents:
- 52e9a45
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernel_header.c
r11ca2ab r218cdbc 148 148 inline double sinc(double x) { return x==0 ? 1.0 : sin(x)/x; } 149 149 150 #define ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sn, cn) do { \ 151 SINCOS(phi*M_PI_180, sn, cn); \ 152 q = sqrt(qx*qx + qy*qy); \ 153 cn = (q==0. ? 1.0 : (cn*qx + sn*qy)/q * cos(theta*M_PI_180)); \ 154 sn = sqrt(1 - cn*cn); \ 155 } while (0) 150 #if 0 151 #define ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sn, cn) do { \ 152 SINCOS(phi*M_PI_180, sn, cn); \ 153 q = sqrt(qx*qx + qy*qy); \ 154 cn = (q==0. ? 1.0 : (cn*qx + sn*qy)/q * cos(theta*M_PI_180)); \ 155 sn = sqrt(1 - cn*cn); \ 156 } while (0) 157 #else 158 // SasView 3.x definition of orientation 159 #define ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sn, cn) do { \ 160 SINCOS(theta*M_PI_180, sn, cn); \ 161 q = sqrt(qx*qx + qy*qy);\ 162 cn = (q==0. ? 1.0 : (cn*cos(phi*M_PI_180)*qx + sn*qy)/q); \ 163 sn = sqrt(1 - cn*cn); \ 164 } while (0) 165 #endif 156 166 157 167 #define ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, cos_alpha, cos_mu, cos_nu) do { \ 158 168 q = sqrt(qx*qx + qy*qy); \ 159 169 const double qxhat = qx/q; \ … … 168 178 cos_mu = (-sin_theta*cos_psi*cos_phi - sin_psi*sin_phi)*qxhat + cos_theta*cos_psi*qyhat; \ 169 179 cos_nu = (-cos_phi*sin_psi*sin_theta + sin_phi*cos_psi)*qxhat + sin_psi*cos_theta*qyhat; \ 170 } while (0)180 } while (0)
Note: See TracChangeset
for help on using the changeset viewer.