Changeset 218cdbc in sasmodels for sasmodels/kernel_header.c


Ignore:
Timestamp:
Oct 17, 2016 9:11:17 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
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
Message:

use SasView? 3.x definition of angles for now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernel_header.c

    r11ca2ab r218cdbc  
    148148inline double sinc(double x) { return x==0 ? 1.0 : sin(x)/x; } 
    149149 
    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 
    156166 
    157  #define ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, cos_alpha, cos_mu, cos_nu) do { \ 
     167#define ORIENT_ASYMMETRIC(qx, qy, theta, phi, psi, q, cos_alpha, cos_mu, cos_nu) do { \ 
    158168    q = sqrt(qx*qx + qy*qy); \ 
    159169    const double qxhat = qx/q; \ 
     
    168178    cos_mu = (-sin_theta*cos_psi*cos_phi - sin_psi*sin_phi)*qxhat + cos_theta*cos_psi*qyhat; \ 
    169179    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.