Ignore:
Timestamp:
Oct 22, 2010 5:50:05 PM (14 years ago)
Author:
Jae Cho <jhjcho@…>
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
Message:

changed the unit of angles into degrees

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/c_extensions/sc.c

    r18f2ca1 r4628e31  
    7373        dp[4] = 0.0; 
    7474 
     75        //convert angle degree to radian 
     76        double theta = pars->theta * Pi/180.0; 
     77        double phi = pars->phi * Pi/180.0; 
     78        double psi = pars->psi * Pi/180.0; 
     79 
    7580        aa = pars->dnn; 
    7681        Da = pars->d_factor*aa; 
     
    8085        /// Angles here are respect to detector coordinate instead of against q coordinate(PRB 36, 3, 1754) 
    8186    // a3 axis orientation 
    82     a3_x = sin(pars->theta) * cos(pars->phi);//negative sign here??? 
    83     a3_y = sin(pars->theta) * sin(pars->phi); 
    84     a3_z = cos(pars->theta); 
     87    a3_x = sin(theta) * cos(phi);//negative sign here??? 
     88    a3_y = sin(theta) * sin(phi); 
     89    a3_z = cos(theta); 
    8590 
    8691    // q vector 
     
    9398    a3_dot_q = aa*q*cos_val_a3; 
    9499    // a1 axis orientation 
    95     a1_x = sin(pars->psi); 
    96     a1_y = cos(pars->psi); 
     100    a1_x = sin(psi); 
     101    a1_y = cos(psi); 
    97102 
    98103    cos_val_a1 = a1_x*q_x + a1_y*q_y; 
     
    100105 
    101106    // a2 axis orientation 
    102     a2_x = sqrt(1.0-sin(pars->theta)*cos(pars->phi))*cos(pars->psi); 
    103     a2_y = sqrt(1.0-sin(pars->theta)*cos(pars->phi))*sin(pars->psi); 
     107    a2_x = sqrt(1.0-sin(theta)*cos(phi))*cos(psi); 
     108    a2_y = sqrt(1.0-sin(theta)*cos(phi))*sin(psi); 
    104109    // a2 axis 
    105110    cos_val_a2 =  sin(acos(cos_val_a1));//a2_x*q_x + a2_y*q_y; 
Note: See TracChangeset for help on using the changeset viewer.