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

Location:
sansmodels/src/sans/models/c_extensions
Files:
29 edited

Legend:

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

    r339ce67 r4628e31  
    142142        dp[6] = pars->background; 
    143143 
     144        //convert angle degree to radian 
     145        double pi = 4.0*atan(1.0); 
     146        double theta = pars->theta * pi/180.0; 
     147        double phi = pars->phi * pi/180.0; 
    144148 
    145149        //double Pi = 4.0*atan(1.0); 
    146150    // Cylinder orientation 
    147     cyl_x = sin(pars->theta) * cos(pars->phi); 
    148     cyl_y = sin(pars->theta) * sin(pars->phi); 
    149     cyl_z = cos(pars->theta); 
     151    cyl_x = sin(theta) * cos(phi); 
     152    cyl_y = sin(theta) * sin(phi); 
     153    cyl_z = cos(theta); 
    150154 
    151155    // q vector 
  • sansmodels/src/sans/models/c_extensions/barbell.h

    r339ce67 r4628e31  
    5858        double background; 
    5959 
    60     /// Angle of the main axis against z-axis in detector plane [rad] 
    61     //  [DEFAULT]=theta=0.0 [rad] 
     60    /// Angle of the main axis against z-axis in detector plane [deg] 
     61    //  [DEFAULT]=theta=0.0 [deg] 
    6262    double theta; 
    63     /// Azimuthal angle around z-axis in detector plane [rad] 
    64     //  [DEFAULT]=phi=0.0 [rad] 
     63    /// Azimuthal angle around z-axis in detector plane [deg] 
     64    //  [DEFAULT]=phi=0.0 [deg] 
    6565    double phi; 
    6666 
  • sansmodels/src/sans/models/c_extensions/bcc.c

    r85bb870 r4628e31  
    7474        dp[4] = 0.0; 
    7575 
     76        //convert angle degree to radian 
     77        double pi = 4.0*atan(1.0); 
     78        double theta = pars->theta * pi/180.0; 
     79        double phi = pars->phi * pi/180.0; 
     80        double psi = pars->psi * pi/180.0; 
     81 
    7682        aa = pars->dnn; 
    7783        Da = pars->d_factor*aa; 
     
    8591        ///  instead of against q coordinate(PRB 36(46), 3(6), 1754(3854)) 
    8692    // b3 axis orientation 
    87     b3_x = sin(pars->theta) * cos(pars->phi);//negative sign here??? 
    88     b3_y = sin(pars->theta) * sin(pars->phi); 
    89     b3_z = cos(pars->theta); 
     93    b3_x = sin(theta) * cos(phi);//negative sign here??? 
     94    b3_y = sin(theta) * sin(phi); 
     95    b3_z = cos(theta); 
    9096    cos_val_b3 =  b3_x*q_x + b3_y*q_y + b3_z*q_z; 
    9197 
    9298    alpha = acos(cos_val_b3); 
    9399    // b1 axis orientation 
    94     b1_x = sin(pars->psi); 
    95     b1_y = cos(pars->psi); 
     100    b1_x = sin(psi); 
     101    b1_y = cos(psi); 
    96102        cos_val_b1 = (b1_x*q_x + b1_y*q_y); 
    97103    // b2 axis orientation 
  • sansmodels/src/sans/models/c_extensions/bcc.h

    rd5b6a9d r4628e31  
    5757        //  [DEFAULT]=background=0 [1/cm] 
    5858        double background; 
    59     /// Orientation of the a1 axis w/respect incoming beam [rad] 
    60     //  [DEFAULT]=theta=0.0 [rad] 
     59    /// Orientation of the a1 axis w/respect incoming beam [deg] 
     60    //  [DEFAULT]=theta=0.0 [deg] 
    6161    double theta; 
    62     /// Orientation of the a2 in the plane of the detector [rad] 
    63     //  [DEFAULT]=phi=0.0 [rad] 
     62    /// Orientation of the a2 in the plane of the detector [deg] 
     63    //  [DEFAULT]=phi=0.0 [deg] 
    6464    double phi; 
    65     /// Orientation of the a3 in the plane of the detector [rad] 
    66     //  [DEFAULT]=psi=0.0 [rad] 
     65    /// Orientation of the a3 in the plane of the detector [deg] 
     66    //  [DEFAULT]=psi=0.0 [deg] 
    6767    double psi; 
    6868 
  • sansmodels/src/sans/models/c_extensions/capcyl.c

    r339ce67 r4628e31  
    142142        dp[6] = pars->background; 
    143143 
     144        //convert angle degree to radian 
     145        double pi = 4.0*atan(1.0); 
     146        double theta = pars->theta * pi/180.0; 
     147        double phi = pars->phi * pi/180.0; 
     148 
    144149 
    145150        //double Pi = 4.0*atan(1.0); 
    146151    // Cylinder orientation 
    147     cyl_x = sin(pars->theta) * cos(pars->phi); 
    148     cyl_y = sin(pars->theta) * sin(pars->phi); 
    149     cyl_z = cos(pars->theta); 
     152    cyl_x = sin(theta) * cos(phi); 
     153    cyl_y = sin(theta) * sin(phi); 
     154    cyl_z = cos(theta); 
    150155 
    151156    // q vector 
  • sansmodels/src/sans/models/c_extensions/capcyl.h

    r18f2ca1 r4628e31  
    5656        double background; 
    5757 
    58     /// Angle of the main axis against z-axis in detector plane [rad] 
    59     //  [DEFAULT]=theta=0.0 [rad] 
     58    /// Angle of the main axis against z-axis in detector plane [deg] 
     59    //  [DEFAULT]=theta=0.0 [deg] 
    6060    double theta; 
    61     /// Azimuthal angle around z-axis in detector plane [rad] 
    62     //  [DEFAULT]=phi=0.0 [rad] 
     61    /// Azimuthal angle around z-axis in detector plane [deg] 
     62    //  [DEFAULT]=phi=0.0 [deg] 
    6363    double phi; 
    6464 
  • sansmodels/src/sans/models/c_extensions/core_shell_cylinder.c

    rae3ce4e r4628e31  
    1818double core_shell_cylinder_analytical_1D(CoreShellCylinderParameters *pars, double q) { 
    1919        double dp[8]; 
    20          
     20 
    2121        dp[0] = pars->scale; 
    2222        dp[1] = pars->radius; 
     
    2727        dp[6] = pars->solvent_sld; 
    2828        dp[7] = pars->background; 
    29          
     29 
    3030        return CoreShellCylinder(dp, q); 
    3131} 
    32      
     32 
    3333/** 
    3434 * Function to evaluate 2D scattering function 
     
    4141        q = sqrt(qx*qx+qy*qy); 
    4242    return core_shell_cylinder_analytical_2D_scaled(pars, q, qx/q, qy/q); 
    43 }  
     43} 
    4444 
    4545/** 
     
    5252double core_shell_cylinder_analytical_2D(CoreShellCylinderParameters *pars, double q, double phi) { 
    5353    return core_shell_cylinder_analytical_2D_scaled(pars, q, cos(phi), sin(phi)); 
    54 }  
     54} 
    5555 
    5656/** 
     
    6565        double cyl_x, cyl_y, cyl_z; 
    6666        double q_z, lenq; 
    67         double theta, alpha, f, vol, sin_val, cos_val; 
     67        double alpha, f, vol, sin_val, cos_val; 
    6868        double answer; 
    69          
     69        //convert angle degree to radian 
     70        double pi = 4.0*atan(1.0); 
     71        double theta = pars->axis_theta * pi/180.0; 
     72        double phi = pars->axis_phi * pi/180.0; 
     73 
    7074    // Cylinder orientation 
    71     cyl_x = sin(pars->axis_theta) * cos(pars->axis_phi); 
    72     cyl_y = sin(pars->axis_theta) * sin(pars->axis_phi); 
    73     cyl_z = cos(pars->axis_theta); 
    74       
     75    cyl_x = sin(theta) * cos(phi); 
     76    cyl_y = sin(theta) * sin(phi); 
     77    cyl_z = cos(theta); 
     78 
    7579    // q vector 
    7680    q_z = 0; 
    77          
     81 
    7882    // Compute the angle btw vector q and the 
    7983    // axis of the cylinder 
    8084    cos_val = cyl_x*q_x + cyl_y*q_y + cyl_z*q_z; 
    81      
     85 
    8286    // The following test should always pass 
    8387    if (fabs(cos_val)>1.0) { 
     
    8589        return 0; 
    8690    } 
    87      
     91 
    8892        alpha = acos( cos_val ); 
    89          
     93 
    9094        // Call the IGOR library function to get the kernel 
    91         answer = CoreShellCylKernel(q, pars->radius, pars->thickness,  
    92                                                                 pars->core_sld,pars->shell_sld,  
    93                                                                 pars->solvent_sld, pars->length/2.0, alpha) / sin(alpha); 
    94          
     95        answer = CoreShellCylKernel(q, pars->radius, pars->thickness, 
     96                                                                pars->core_sld,pars->shell_sld, 
     97                                                                pars->solvent_sld, pars->length/2.0, alpha) / fabs(sin(alpha)); 
     98 
    9599        //normalize by cylinder volume 
    96         vol=acos(-1.0)*(pars->radius+pars->thickness) 
     100        vol=pi*(pars->radius+pars->thickness) 
    97101                        *(pars->radius+pars->thickness) 
    98102                        *(pars->length+2.0*pars->thickness); 
    99103        answer /= vol; 
    100          
     104 
    101105        //convert to [cm-1] 
    102106        answer *= 1.0e8; 
    103          
     107 
    104108        //Scale 
    105109        answer *= pars->scale; 
    106          
     110 
    107111        // add in the background 
    108112        answer += pars->background; 
    109          
     113 
    110114        return answer; 
    111115} 
  • sansmodels/src/sans/models/c_extensions/core_shell_cylinder.h

    r27972c1d r4628e31  
    6969        double background; 
    7070 
    71     /// Orientation of the long axis of the core-shell cylinder w/respect incoming beam [rad] 
    72     //  [DEFAULT]=axis_theta=1.57 [rad] 
     71    /// Orientation of the long axis of the core-shell cylinder w/respect incoming beam [deg] 
     72    //  [DEFAULT]=axis_theta=90.0 [deg] 
    7373    double axis_theta; 
    7474 
    75     /// Orientation of the long axis of the core-shell cylinder in the plane of the detector [rad] 
    76     //  [DEFAULT]=axis_phi=0.0 [rad] 
     75    /// Orientation of the long axis of the core-shell cylinder in the plane of the detector [deg] 
     76    //  [DEFAULT]=axis_phi=0.0 [deg] 
    7777    double axis_phi; 
    7878 
  • sansmodels/src/sans/models/c_extensions/csparallelepiped.c

    r18f2ca1 r4628e31  
    4848        double rhoA,rhoB,rhoC, rhoP, rhosolv; 
    4949        double dr0, drA,drB, drC; 
    50         double Pi,retVal; 
     50        double retVal; 
    5151 
    5252        aa = dp[1]; 
     
    181181 
    182182        double answer; 
    183         double pi = 4.0*atan(1.0); 
    184183 
    185184        edgeA = pars->shortA; 
     
    187186        edgeC = pars->longC; 
    188187 
     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; 
    189193 
    190194    // 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); 
    194198 
    195199    // q vector 
     
    202206 
    203207    // parallelepiped a axis orientation 
    204     parallel_x = sin(pars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)*sin(pars->parallel_psi); 
    205     parallel_y = cos(pars->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); 
    206210 
    207211    cos_val_a = parallel_x*q_x + parallel_y*q_y; 
     
    210214 
    211215    // 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); 
    214218    // axis of the parallelepiped 
    215219    cos_val_b = sin(acos(cos_val_a)) ; 
  • sansmodels/src/sans/models/c_extensions/csparallelepiped.h

    r18f2ca1 r4628e31  
    6868        //  [DEFAULT]=background=0.06 [1/cm] 
    6969        double background; 
    70     /// Orientation of the parallelepiped axis w/respect incoming beam [rad] 
    71     //  [DEFAULT]=parallel_theta=0.0 [rad] 
     70    /// Orientation of the parallelepiped axis w/respect incoming beam [deg] 
     71    //  [DEFAULT]=parallel_theta=0.0 [deg] 
    7272    double parallel_theta; 
    73     /// Orientation of the longitudinal axis of the parallelepiped in the plane of the detector [rad] 
    74     //  [DEFAULT]=parallel_phi=0.0 [rad] 
     73    /// Orientation of the longitudinal axis of the parallelepiped in the plane of the detector [deg] 
     74    //  [DEFAULT]=parallel_phi=0.0 [deg] 
    7575    double parallel_phi; 
    76     /// Orientation of the cross-sectional minor axis of the parallelepiped in the plane of the detector [rad] 
    77     //  [DEFAULT]=parallel_psi=0.0 [rad] 
     76    /// Orientation of the cross-sectional minor axis of the parallelepiped in the plane of the detector [deg] 
     77    //  [DEFAULT]=parallel_psi=0.0 [deg] 
    7878    double parallel_psi; 
    7979 
  • sansmodels/src/sans/models/c_extensions/cylinder.c

    rf10063e r4628e31  
    6969        double alpha, vol, cos_val; 
    7070        double answer; 
     71        //convert angle degree to radian 
     72        double pi = 4.0*atan(1.0); 
     73        double theta = pars->cyl_theta * pi/180.0; 
     74        double phi = pars->cyl_phi * pi/180.0; 
    7175 
    7276    // Cylinder orientation 
    73     cyl_x = sin(pars->cyl_theta) * cos(pars->cyl_phi); 
    74     cyl_y = sin(pars->cyl_theta) * sin(pars->cyl_phi); 
    75     cyl_z = cos(pars->cyl_theta); 
     77    cyl_x = sin(theta) * cos(phi); 
     78    cyl_y = sin(theta) * sin(phi); 
     79    cyl_z = cos(theta); 
    7680 
    7781    // q vector 
  • sansmodels/src/sans/models/c_extensions/cylinder.h

    rf10063e r4628e31  
    4242        //  [DEFAULT]=background=0.0 [1/cm] 
    4343        double background; 
    44     /// Orientation of the cylinder axis w/respect incoming beam [rad] 
    45     //  [DEFAULT]=cyl_theta=1.0 [rad] 
     44    /// Orientation of the cylinder axis w/respect incoming beam [deg] 
     45    //  [DEFAULT]=cyl_theta=60.0 [deg] 
    4646    double cyl_theta; 
    47     /// Orientation of the cylinder in the plane of the detector [rad] 
    48     //  [DEFAULT]=cyl_phi=1.0 [rad] 
     47    /// Orientation of the cylinder in the plane of the detector [deg] 
     48    //  [DEFAULT]=cyl_phi=60.0 [deg] 
    4949    double cyl_phi; 
    5050 
  • sansmodels/src/sans/models/c_extensions/ellipsoid.c

    r8f20419d r4628e31  
    9090        double cyl_x, cyl_y, cyl_z; 
    9191        double q_z, lenq; 
    92         double theta, alpha, f, vol, sin_val, cos_val; 
     92        double alpha, f, vol, sin_val, cos_val; 
    9393        double answer; 
     94        //convert angle degree to radian 
     95        double pi = 4.0*atan(1.0); 
     96        double theta = pars->axis_theta * pi/180.0; 
     97        double phi = pars->axis_phi * pi/180.0; 
    9498 
    9599    // Ellipsoid orientation 
    96     cyl_x = sin(pars->axis_theta) * cos(pars->axis_phi); 
    97     cyl_y = sin(pars->axis_theta) * sin(pars->axis_phi); 
    98     cyl_z = cos(pars->axis_theta); 
     100    cyl_x = sin(theta) * cos(phi); 
     101    cyl_y = sin(theta) * sin(phi); 
     102    cyl_z = cos(theta); 
    99103 
    100104    // q vector 
  • sansmodels/src/sans/models/c_extensions/ellipsoid.h

    rf10063e r4628e31  
    5858        double background; 
    5959 
    60     /// Orientation of the long axis of the ellipsoid w/respect incoming beam [rad] 
    61     //  [DEFAULT]=axis_theta=1.57 [rad] 
     60    /// Orientation of the long axis of the ellipsoid w/respect incoming beam [deg] 
     61    //  [DEFAULT]=axis_theta=90.0 [deg] 
    6262    double axis_theta; 
    63     /// Orientation of the long axis of the ellipsoid in the plane of the detector [rad] 
    64     //  [DEFAULT]=axis_phi=0.0 [rad] 
     63    /// Orientation of the long axis of the ellipsoid in the plane of the detector [deg] 
     64    //  [DEFAULT]=axis_phi=0.0 [deg] 
    6565    double axis_phi; 
    6666} EllipsoidParameters; 
  • sansmodels/src/sans/models/c_extensions/elliptical_cylinder.c

    rf10063e r4628e31  
    9999        double nu, cos_nu; 
    100100        double answer; 
     101        //convert angle degree to radian 
     102        double pi = 4.0*atan(1.0); 
     103        double theta = pars->cyl_theta * pi/180.0; 
     104        double phi = pars->cyl_phi * pi/180.0; 
     105        double psi = pars->cyl_psi * pi/180.0; 
    101106 
    102107    //Cylinder orientation 
    103     cyl_x = sin(pars->cyl_theta) * cos(pars->cyl_phi); 
    104     cyl_y = sin(pars->cyl_theta) * sin(pars->cyl_phi); 
    105     cyl_z = cos(pars->cyl_theta); 
     108    cyl_x = sin(theta) * cos(phi); 
     109    cyl_y = sin(theta) * sin(phi); 
     110    cyl_z = cos(theta); 
    106111 
    107112    // q vector 
     
    130135 
    131136        //x- y- component on the detector plane. 
    132     ell_x =  cos(pars->cyl_psi); 
    133     ell_y =  sin(pars->cyl_psi); 
     137    ell_x =  cos(psi); 
     138    ell_y =  sin(psi); 
    134139 
    135140    // calculate the axis of the ellipse wrt q-coord. 
  • sansmodels/src/sans/models/c_extensions/elliptical_cylinder.h

    rf10063e r4628e31  
    4141        //  [DEFAULT]=background=0 [1/cm] 
    4242        double background; 
    43     /// Orientation of the cylinder axis w/respect incoming beam [rad] 
    44     //  [DEFAULT]=cyl_theta=1.57 [rad] 
     43    /// Orientation of the cylinder axis w/respect incoming beam [deg] 
     44    //  [DEFAULT]=cyl_theta=90.0 [deg] 
    4545    double cyl_theta; 
    46     /// Orientation of the cylinder in the plane of the detector [rad] 
    47     //  [DEFAULT]=cyl_phi=0.0 [rad] 
     46    /// Orientation of the cylinder in the plane of the detector [deg] 
     47    //  [DEFAULT]=cyl_phi=0.0 [deg] 
    4848    double cyl_phi; 
    49     /// Orientation of major radius of the cross-section w/respect vector q [rad] 
    50     //  [DEFAULT]=cyl_psi=0.0 [rad] 
     49    /// Orientation of major radius of the cross-section w/respect vector q [deg] 
     50    //  [DEFAULT]=cyl_psi=0.0 [deg] 
    5151    double cyl_psi; 
    5252} EllipticalCylinderParameters; 
  • sansmodels/src/sans/models/c_extensions/fcc.c

    r85bb870 r4628e31  
    7373        dp[3] = pars->sldSolv; 
    7474        dp[4] = 0.0; 
     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; 
    7579 
    7680        aa = pars->dnn; 
     
    8589        ///  instead of against q coordinate in PRB 36(46), 3(6), 1754(3854) 
    8690    // b3 axis orientation 
    87     b3_x = sin(pars->theta) * cos(pars->phi);//negative sign here??? 
    88     b3_y = sin(pars->theta) * sin(pars->phi); 
    89     b3_z = cos(pars->theta); 
     91    b3_x = sin(theta) * cos(phi);//negative sign here??? 
     92    b3_y = sin(theta) * sin(phi); 
     93    b3_z = cos(theta); 
    9094    cos_val_b3 =  b3_x*q_x + b3_y*q_y + b3_z*q_z; 
    9195    alpha = acos(cos_val_b3); 
    9296    // b1 axis orientation 
    93     b1_x = sin(pars->psi); 
    94     b1_y = cos(pars->psi); 
     97    b1_x = sin(psi); 
     98    b1_y = cos(psi); 
    9599        cos_val_b1 = (b1_x*q_x + b1_y*q_y); 
    96100    // b2 axis orientation 
  • sansmodels/src/sans/models/c_extensions/fcc.h

    rd5b6a9d r4628e31  
    5757        //  [DEFAULT]=background=0 [1/cm] 
    5858        double background; 
    59     /// Orientation of the a1 axis w/respect incoming beam [rad] 
    60     //  [DEFAULT]=theta=0.0 [rad] 
     59    /// Orientation of the a1 axis w/respect incoming beam [deg] 
     60    //  [DEFAULT]=theta=0.0 [deg] 
    6161    double theta; 
    62     /// Orientation of the a2 in the plane of the detector [rad] 
    63     //  [DEFAULT]=phi=0.0 [rad] 
     62    /// Orientation of the a2 in the plane of the detector [deg] 
     63    //  [DEFAULT]=phi=0.0 [deg] 
    6464    double phi; 
    65     /// Orientation of the a3 in the plane of the detector [rad] 
    66     //  [DEFAULT]=psi=0.0 [rad] 
     65    /// Orientation of the a3 in the plane of the detector [deg] 
     66    //  [DEFAULT]=psi=0.0 [deg] 
    6767    double psi; 
    6868 
  • sansmodels/src/sans/models/c_extensions/hollow_cylinder.c

    r2339249f r4628e31  
    6666        double  alpha,vol, cos_val; 
    6767        double answer; 
     68        //convert angle degree to radian 
     69        double pi = 4.0*atan(1.0); 
     70        double theta = pars->axis_theta * pi/180.0; 
     71        double phi = pars->axis_phi * pi/180.0; 
    6872 
    6973    // Cylinder orientation 
    70     cyl_x = sin(pars->axis_theta) * cos(pars->axis_phi); 
    71     cyl_y = sin(pars->axis_theta) * sin(pars->axis_phi); 
    72     cyl_z = cos(pars->axis_theta); 
     74    cyl_x = sin(theta) * cos(phi); 
     75    cyl_y = sin(theta) * sin(phi); 
     76    cyl_z = cos(theta); 
    7377 
    7478    // q vector 
     
    9498 
    9599        //normalize by cylinder volume 
    96         vol=acos(-1.0)*((pars->radius*pars->radius)-(pars->core_radius *pars->core_radius)) 
     100        vol=pi*((pars->radius*pars->radius)-(pars->core_radius *pars->core_radius)) 
    97101                        *(pars->length); 
    98         answer /= vol; 
     102        answer *= vol; 
    99103 
    100104        //convert to [cm-1] 
  • sansmodels/src/sans/models/c_extensions/hollow_cylinder.h

    rf10063e r4628e31  
    4848        double background; 
    4949 
    50     /// Orientation of the long axis of the hollow cylinder w/respect incoming beam [rad] 
    51     //  [DEFAULT]=axis_theta=1.57 [rad] 
     50    /// Orientation of the long axis of the hollow cylinder w/respect incoming beam [deg] 
     51    //  [DEFAULT]=axis_theta=90.0 [deg] 
    5252    double axis_theta; 
    5353 
    54     /// Orientation of the long axis of the hollow cylinder in the plane of the detector [rad] 
    55     //  [DEFAULT]=axis_phi=0.0 [rad] 
     54    /// Orientation of the long axis of the hollow cylinder in the plane of the detector [deg] 
     55    //  [DEFAULT]=axis_phi=0.0 [deg] 
    5656    double axis_phi; 
    5757 
  • sansmodels/src/sans/models/c_extensions/oblate.h

    r27972c1d r4628e31  
    5353        double background; 
    5454        //Disable for now 
    55     /// Orientation of the oblate axis w/respect incoming beam [rad] 
    56     //  [DEFAULT]=axis_theta=1.0 [rad] 
     55    /// Orientation of the oblate axis w/respect incoming beam [deg] 
     56    //  [DEFAULT]=axis_theta=57.325 [deg] 
    5757    double axis_theta; 
    58     /// Orientation of the oblate in the plane of the detector [rad] 
    59     //  [DEFAULT]=axis_phi=1.0 [rad] 
     58    /// Orientation of the oblate in the plane of the detector [deg] 
     59    //  [DEFAULT]=axis_phi=57.325 [deg] 
    6060    double axis_phi; 
    6161 
  • sansmodels/src/sans/models/c_extensions/parallelepiped.c

    ra1ecfc3 r4628e31  
    110110        edgeC = pars->long_c; 
    111111 
     112        //convert angle degree to radian 
     113        double theta = pars->parallel_theta * pi/180.0; 
     114        double phi = pars->parallel_phi * pi/180.0; 
     115        double psi = pars->parallel_psi * pi/180.0; 
    112116 
    113117    // parallelepiped c axis orientation 
    114     cparallel_x = sin(pars->parallel_theta) * cos(pars->parallel_phi); 
    115     cparallel_y = sin(pars->parallel_theta) * sin(pars->parallel_phi); 
    116     cparallel_z = cos(pars->parallel_theta); 
     118    cparallel_x = sin(theta) * cos(phi); 
     119    cparallel_y = sin(theta) * sin(phi); 
     120    cparallel_z = cos(theta); 
    117121 
    118122    // q vector 
     
    125129 
    126130    // parallelepiped a axis orientation 
    127     parallel_x = sin(pars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)*sin(pars->parallel_psi); 
    128     parallel_y = cos(pars->parallel_psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)*cos(pars->parallel_psi); 
     131    parallel_x = sin(psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)*sin(pars->parallel_psi); 
     132    parallel_y = cos(psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)*cos(pars->parallel_psi); 
    129133 
    130134    cos_val_a = parallel_x*q_x + parallel_y*q_y; 
     
    133137 
    134138    // parallelepiped b axis orientation 
    135     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); 
    136     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); 
     139    bparallel_x = sqrt(1.0-sin(theta)*cos(phi))*cos(psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)* cos(pars->parallel_psi); 
     140    bparallel_y = sqrt(1.0-sin(theta)*cos(phi))*sin(psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)* sin(pars->parallel_psi); 
    137141    // axis of the parallelepiped 
    138142    cos_val_b = sin(acos(cos_val_a)) ; 
  • sansmodels/src/sans/models/c_extensions/parallelepiped.h

    rf10063e r4628e31  
    4545        //  [DEFAULT]=background=0.0 [1/cm] 
    4646        double background; 
    47     /// Orientation of the parallelepiped axis w/respect incoming beam [rad] 
    48     //  [DEFAULT]=parallel_theta=0.0 [rad] 
     47    /// Orientation of the parallelepiped axis w/respect incoming beam [deg] 
     48    //  [DEFAULT]=parallel_theta=0.0 [deg] 
    4949    double parallel_theta; 
    50     /// Orientation of the longitudinal axis of the parallelepiped in the plane of the detector [rad] 
    51     //  [DEFAULT]=parallel_phi=0.0 [rad] 
     50    /// Orientation of the longitudinal axis of the parallelepiped in the plane of the detector [deg] 
     51    //  [DEFAULT]=parallel_phi=0.0 [deg] 
    5252    double parallel_phi; 
    53     /// Orientation of the cross-sectional minor axis of the parallelepiped in the plane of the detector [rad] 
    54     //  [DEFAULT]=parallel_psi=0.0 [rad] 
     53    /// Orientation of the cross-sectional minor axis of the parallelepiped in the plane of the detector [deg] 
     54    //  [DEFAULT]=parallel_psi=0.0 [deg] 
    5555    double parallel_psi; 
    5656 
  • 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; 
  • sansmodels/src/sans/models/c_extensions/sc.h

    rd5b6a9d r4628e31  
    5757        //  [DEFAULT]=background=0 [1/cm] 
    5858        double background; 
    59     /// Orientation of the a1 axis w/respect incoming beam [rad] 
    60     //  [DEFAULT]=theta=0.0 [rad] 
     59    /// Orientation of the a1 axis w/respect incoming beam [deg] 
     60    //  [DEFAULT]=theta=0.0 [deg] 
    6161    double theta; 
    62     /// Orientation of the a2 in the plane of the detector [rad] 
    63     //  [DEFAULT]=phi=0.0 [rad] 
     62    /// Orientation of the a2 in the plane of the detector [deg] 
     63    //  [DEFAULT]=phi=0.0 [deg] 
    6464    double phi; 
    65     /// Orientation of the a3 in the plane of the detector [rad] 
    66     //  [DEFAULT]=psi=0.0 [rad] 
     65    /// Orientation of the a3 in the plane of the detector [deg] 
     66    //  [DEFAULT]=psi=0.0 [deg] 
    6767    double psi; 
    6868 
  • sansmodels/src/sans/models/c_extensions/spheroid.c

    rf10063e r4628e31  
    7575        double sldcs,sldss; 
    7676 
     77        //convert angle degree to radian 
     78        double theta = pars->axis_theta * Pi/180.0; 
     79        double phi = pars->axis_phi * Pi/180.0; 
     80 
     81 
    7782    // ellipsoid orientation, the axis of the rotation is consistent with the ploar axis. 
    78     cyl_x = sin(pars->axis_theta) * cos(pars->axis_phi); 
    79     cyl_y = sin(pars->axis_theta) * sin(pars->axis_phi); 
    80     cyl_z = cos(pars->axis_theta); 
     83    cyl_x = sin(theta) * cos(phi); 
     84    cyl_y = sin(theta) * sin(phi); 
     85    cyl_z = cos(theta); 
    8186    //del sld 
    8287    sldcs = pars->sld_core - pars->sld_shell; 
  • sansmodels/src/sans/models/c_extensions/spheroid.h

    rf10063e r4628e31  
    5959        double background; 
    6060        //Disable for now 
    61     /// Orientation of the oblate axis w/respect incoming beam [rad] 
    62     //  [DEFAULT]=axis_theta=0.0 [rad] 
     61    /// Orientation of the oblate axis w/respect incoming beam [deg] 
     62    //  [DEFAULT]=axis_theta=0.0 [deg] 
    6363    double axis_theta; 
    64     /// Orientation of the oblate in the plane of the detector [rad] 
    65     //  [DEFAULT]=axis_phi=0.0 [rad] 
     64    /// Orientation of the oblate in the plane of the detector [deg] 
     65    //  [DEFAULT]=axis_phi=0.0 [deg] 
    6666    double axis_phi; 
    6767 
  • sansmodels/src/sans/models/c_extensions/triaxial_ellipsoid.c

    r8f20419d r4628e31  
    9090        double alpha, vol, cos_val; 
    9191        double answer; 
    92     double pi = acos(-1.0); 
     92    double pi = 4.0*atan(1.0); 
     93 
     94        //convert angle degree to radian 
     95        double theta = pars->axis_theta * pi/180.0; 
     96        double phi = pars->axis_phi * pi/180.0; 
     97        double psi = pars->axis_psi * pi/180.0; 
     98 
    9399    // Cylinder orientation 
    94     cyl_x = sin(pars->axis_theta) * cos(pars->axis_phi); 
    95     cyl_y = sin(pars->axis_theta) * sin(pars->axis_phi); 
    96     cyl_z = cos(pars->axis_theta); 
     100    cyl_x = sin(theta) * cos(phi); 
     101    cyl_y = sin(theta) * sin(phi); 
     102    cyl_z = cos(theta); 
    97103 
    98104    // q vector 
     
    123129 
    124130        //x- y- component on the detector plane. 
    125     ell_x =  cos(pars->axis_psi); 
    126     ell_y =  sin(pars->axis_psi); 
     131    ell_x =  cos(psi); 
     132    ell_y =  sin(psi); 
    127133 
    128134    // calculate the axis of the ellipse wrt q-coord. 
  • sansmodels/src/sans/models/c_extensions/triaxial_ellipsoid.h

    r186c4eb r4628e31  
    3333        //  [DEFAULT]=background=0.0 [1/cm] 
    3434        double background; 
    35     /// Orientation of the triaxial_ellipsoid axis w/respect incoming beam [rad] 
    36     //  [DEFAULT]=axis_theta=1.0 [rad] 
     35    /// Orientation of the triaxial_ellipsoid axis w/respect incoming beam [deg] 
     36    //  [DEFAULT]=axis_theta=57.325 [deg] 
    3737    double axis_theta; 
    38     /// Orientation of the triaxial_ellipsoid in the plane of the detector [rad] 
    39     //  [DEFAULT]=axis_phi=1.0 [rad] 
     38    /// Orientation of the triaxial_ellipsoid in the plane of the detector [deg] 
     39    //  [DEFAULT]=axis_phi=57.325 [deg] 
    4040    double axis_phi; 
    41     /// Orientation of the cross section of the triaxial_ellipsoid in the plane of the detector [rad] 
    42     //  [DEFAULT]=axis_psi=0.0 [rad] 
     41    /// Orientation of the cross section of the triaxial_ellipsoid in the plane of the detector [deg] 
     42    //  [DEFAULT]=axis_psi=0.0 [deg] 
    4343    double axis_psi; 
    4444 
Note: See TracChangeset for help on using the changeset viewer.