Changeset 4628e31 in sasview for sansmodels/src/sans/models/c_extensions/csparallelepiped.c
- Timestamp:
- Oct 22, 2010 5:50:05 PM (14 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:
- d7b7156
- Parents:
- 67e258c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_extensions/csparallelepiped.c
r18f2ca1 r4628e31 48 48 double rhoA,rhoB,rhoC, rhoP, rhosolv; 49 49 double dr0, drA,drB, drC; 50 double Pi,retVal;50 double retVal; 51 51 52 52 aa = dp[1]; … … 181 181 182 182 double answer; 183 double pi = 4.0*atan(1.0);184 183 185 184 edgeA = pars->shortA; … … 187 186 edgeC = pars->longC; 188 187 188 //convert angle degree to radian 189 double pi = 4.0*atan(1.0); 190 double theta = pars->parallel_theta * pi/180.0; 191 double phi = pars->parallel_phi * pi/180.0; 192 double psi = pars->parallel_psi* pi/180.0; 189 193 190 194 // parallelepiped c axis orientation 191 cparallel_x = sin( pars->parallel_theta) * cos(pars->parallel_phi);192 cparallel_y = sin( pars->parallel_theta) * sin(pars->parallel_phi);193 cparallel_z = cos( pars->parallel_theta);195 cparallel_x = sin(theta) * cos(phi); 196 cparallel_y = sin(theta) * sin(phi); 197 cparallel_z = cos(theta); 194 198 195 199 // q vector … … 202 206 203 207 // parallelepiped a axis orientation 204 parallel_x = sin(p ars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)*sin(pars->parallel_psi);205 parallel_y = cos(p ars->parallel_psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)*cos(pars->parallel_psi);208 parallel_x = sin(psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)*sin(pars->parallel_psi); 209 parallel_y = cos(psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)*cos(pars->parallel_psi); 206 210 207 211 cos_val_a = parallel_x*q_x + parallel_y*q_y; … … 210 214 211 215 // parallelepiped b axis orientation 212 bparallel_x = sqrt(1.0-sin( pars->parallel_theta)*cos(pars->parallel_phi))*cos(pars->parallel_psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)* cos(pars->parallel_psi);213 bparallel_y = sqrt(1.0-sin( pars->parallel_theta)*cos(pars->parallel_phi))*sin(pars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)* sin(pars->parallel_psi);216 bparallel_x = sqrt(1.0-sin(theta)*cos(phi))*cos(psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)* cos(pars->parallel_psi); 217 bparallel_y = sqrt(1.0-sin(theta)*cos(phi))*sin(psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)* sin(pars->parallel_psi); 214 218 // axis of the parallelepiped 215 219 cos_val_b = sin(acos(cos_val_a)) ;
Note: See TracChangeset
for help on using the changeset viewer.