Index: sasmodels/models/capped_cylinder.c
===================================================================
--- sasmodels/models/capped_cylinder.c	(revision 0d6e86566d51a1fba22933bdbac8c40d36f9bd76)
+++ sasmodels/models/capped_cylinder.c	(revision 5bddd89a3ed5b121f80ca5d5663daeb28ce822d8)
@@ -49,4 +49,16 @@
 }
 
+static double
+_fq(double q, double h, double radius_cap, double radius, double half_length,
+    double sin_alpha, double cos_alpha)
+{
+    const double cap_Fq = _cap_kernel(q, h, radius_cap, half_length, sin_alpha, cos_alpha);
+    const double bj = sas_J1c(q*radius*sin_alpha);
+    const double si = sinc(q*half_length*cos_alpha);
+    const double cyl_Fq = 2.*M_PI*radius*radius*half_length*bj*si;
+    const double Aq = cap_Fq + cyl_Fq;
+    return Aq;
+}
+
 double form_volume(double radius, double radius_cap, double length)
 {
@@ -93,10 +105,7 @@
         SINCOS(alpha, sin_alpha, cos_alpha);
 
-        const double cap_Fq = _cap_kernel(q, h, radius_cap, half_length, sin_alpha, cos_alpha);
-        const double bj = sas_J1c(q*radius*sin_alpha);
-        const double si = sinc(q*half_length*cos_alpha);
-        const double cyl_Fq = M_PI*radius*radius*length*bj*si;
-        const double Aq = cap_Fq + cyl_Fq;
-        total += Gauss76Wt[i] * Aq * Aq * sin_alpha; // sin_alpha for spherical coord integration
+        const double Aq = _fq(q, h, radius_cap, radius, half_length, sin_alpha, cos_alpha);
+        // sin_alpha for spherical coord integration
+        total += Gauss76Wt[i] * Aq * Aq * sin_alpha;
     }
     // translate dx in [-1,1] to dx in [lower,upper]
@@ -114,21 +123,9 @@
     double theta, double phi)
 {
-    // Compute angle alpha between q and the cylinder axis
-    double sn, cn;
-    SINCOS(phi*M_PI_180, sn, cn);
-    const double q = sqrt(qx*qx+qy*qy);
-    const double cos_val = (q==0. ? 1.0 : (cn*qx + sn*qy)*sin(theta*M_PI_180)/q);
-    const double alpha = acos(cos_val); // rod angle relative to q
+    double q, sin_alpha, cos_alpha;
+    ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);
 
     const double h = sqrt(radius_cap*radius_cap - radius*radius);
-    const double half_length = 0.5*length;
-
-    double sin_alpha, cos_alpha; // slots to hold sincos function output
-    SINCOS(alpha, sin_alpha, cos_alpha);
-    const double cap_Fq = _cap_kernel(q, h, radius_cap, half_length, sin_alpha, cos_alpha);
-    const double bj = sas_J1c(q*radius*sin_alpha);
-    const double si = sinc(q*half_length*cos_alpha);
-    const double cyl_Fq = M_PI*radius*radius*length*bj*si;
-    const double Aq = cap_Fq + cyl_Fq;
+    const double Aq = _fq(q, h, radius_cap, radius, 0.5*length, sin_alpha, cos_alpha);
 
     // Multiply by contrast^2 and convert to cm-1
Index: sasmodels/models/core_shell_bicelle.c
===================================================================
--- sasmodels/models/core_shell_bicelle.c	(revision 0d6e86566d51a1fba22933bdbac8c40d36f9bd76)
+++ sasmodels/models/core_shell_bicelle.c	(revision 5bddd89a3ed5b121f80ca5d5663daeb28ce822d8)
@@ -26,5 +26,5 @@
 double form_volume(double radius, double thick_rim, double thick_face, double length)
 {
-    return M_PI*(radius+thick_rim)*(radius+thick_rim)*(length+2*thick_face);
+    return M_PI*(radius+thick_rim)*(radius+thick_rim)*(length+2.0*thick_face);
 }
 
@@ -39,5 +39,6 @@
               double rhor,
               double rhosolv,
-              double dum)
+              double sin_alpha,
+              double cos_alpha)
 {
     double si1,si2,be1,be2;
@@ -49,10 +50,8 @@
     const double vol2 = M_PI*(rad+radthick)*(rad+radthick)*2.0*(length+facthick);
     const double vol3 = M_PI*rad*rad*2.0*(length+facthick);
-    double sn,cn;
-    SINCOS(dum, sn, cn);
-    double besarg1 = qq*rad*sn;
-    double besarg2 = qq*(rad+radthick)*sn;
-    double sinarg1 = qq*length*cn;
-    double sinarg2 = qq*(length+facthick)*cn;
+    double besarg1 = qq*rad*sin_alpha;
+    double besarg2 = qq*(rad+radthick)*sin_alpha;
+    double sinarg1 = qq*length*cos_alpha;
+    double sinarg2 = qq*(length+facthick)*cos_alpha;
 
     be1 = sas_J1c(besarg1);
@@ -65,7 +64,7 @@
                      vol3*dr3*si2*be1;
 
-    const double retval = t*t*sn;
+    const double retval = t*t*sin_alpha;
 
-    return(retval);
+    return retval;
 
 }
@@ -83,12 +82,15 @@
 {
     // set up the integration end points
-    const double uplim = M_PI/4;
-    const double halfheight = length/2.0;
+    const double uplim = M_PI_4;
+    const double halfheight = 0.5*length;
 
     double summ = 0.0;
     for(int i=0;i<N_POINTS_76;i++) {
-        double zi = (Gauss76Z[i] + 1.0)*uplim;
+        double alpha = (Gauss76Z[i] + 1.0)*uplim;
+        double sin_alpha, cos_alpha; // slots to hold sincos function output
+        SINCOS(alpha, sin_alpha, cos_alpha);
         double yyy = Gauss76Wt[i] * bicelle_kernel(qq, rad, radthick, facthick,
-                             halfheight, rhoc, rhoh, rhor,rhosolv, zi);
+                             halfheight, rhoc, rhoh, rhor, rhosolv,
+                             sin_alpha, cos_alpha);
         summ += yyy;
     }
@@ -96,9 +98,9 @@
     // calculate value of integral to return
     double answer = uplim*summ;
-    return(answer);
+    return answer;
 }
 
 static double
-bicelle_kernel_2d(double q, double q_x, double q_y,
+bicelle_kernel_2d(double qx, double qy,
           double radius,
           double thick_rim,
@@ -112,20 +114,10 @@
           double phi)
 {
-    //convert angle degree to radian
-    theta *= M_PI_180;
-    phi *= M_PI_180;
+    double q, sin_alpha, cos_alpha;
+    ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);
 
-    // Cylinder orientation
-    const double cyl_x = sin(theta) * cos(phi);
-    const double cyl_y = sin(theta) * sin(phi);
-
-    // Compute the angle btw vector q and the axis of the cylinder
-    const double cos_val = cyl_x*q_x + cyl_y*q_y;
-    const double alpha = acos( cos_val );
-
-    // Get the kernel
     double answer = bicelle_kernel(q, radius, thick_rim, thick_face,
-                           length/2.0, core_sld, face_sld, rim_sld,
-                           solvent_sld, alpha) / fabs(sin(alpha));
+                           0.5*length, core_sld, face_sld, rim_sld,
+                           solvent_sld, sin_alpha, cos_alpha) / fabs(sin_alpha);
 
     answer *= 1.0e-4;
@@ -162,7 +154,5 @@
           double phi)
 {
-    double q;
-    q = sqrt(qx*qx+qy*qy);
-    double intensity = bicelle_kernel_2d(q, qx/q, qy/q,
+    double intensity = bicelle_kernel_2d(qx, qy,
                       radius,
                       thick_rim,
Index: sasmodels/models/core_shell_cylinder.c
===================================================================
--- sasmodels/models/core_shell_cylinder.c	(revision 0d6e86566d51a1fba22933bdbac8c40d36f9bd76)
+++ sasmodels/models/core_shell_cylinder.c	(revision 5bddd89a3ed5b121f80ca5d5663daeb28ce822d8)
@@ -11,12 +11,10 @@
 double _cyl(double twovd, double besarg, double siarg)
 {
-    const double bj = (besarg == 0.0 ? 0.5 : 0.5*sas_J1c(besarg));
-    const double si = (siarg == 0.0 ? 1.0 : sin(siarg)/siarg);
-    return twovd*si*bj;
+    return twovd * sinc(siarg) * sas_J1c(besarg);
 }
 
 double form_volume(double radius, double thickness, double length)
 {
-    return M_PI*(radius+thickness)*(radius+thickness)*(length+2*thickness);
+    return M_PI*(radius+thickness)*(radius+thickness)*(length+2.0*thickness);
 }
 
@@ -66,14 +64,6 @@
     double phi)
 {
-    double sn, cn; // slots to hold sincos function output
-
-    // Compute angle alpha between q and the cylinder axis
-    SINCOS(phi*M_PI_180, sn, cn);
-    // # The following correction factor exists in sasview, but it can't be
-    // # right, so we are leaving it out for now.
-    // const double correction = fabs(cn)*M_PI_2;
-    const double q = sqrt(qx*qx+qy*qy);
-    const double cos_val = (q==0. ? 1.0 : (cn*qx + sn*qy)*sin(theta*M_PI_180)/q);
-    const double alpha = acos(cos_val);
+    double q, sin_alpha, cos_alpha;
+    ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);
 
     const double core_qr = q*radius;
@@ -86,7 +76,6 @@
                              * (shell_sld-solvent_sld);
 
-    SINCOS(alpha, sn, cn);
-    const double fq = _cyl(core_twovd, core_qr*sn, core_qh*cn)
-        + _cyl(shell_twovd, shell_qr*sn, shell_qh*cn);
+    const double fq = _cyl(core_twovd, core_qr*sin_alpha, core_qh*cos_alpha)
+        + _cyl(shell_twovd, shell_qr*sin_alpha, shell_qh*cos_alpha);
     return 1.0e-4 * fq * fq;
 }
Index: sasmodels/models/core_shell_ellipsoid.c
===================================================================
--- sasmodels/models/core_shell_ellipsoid.c	(revision 0d6e86566d51a1fba22933bdbac8c40d36f9bd76)
+++ sasmodels/models/core_shell_ellipsoid.c	(revision 5bddd89a3ed5b121f80ca5d5663daeb28ce822d8)
@@ -32,5 +32,5 @@
     const double equat_shell = radius_equat_core + thick_shell;
     const double polar_shell = radius_equat_core*x_core + thick_shell*x_polar_shell;
-    double vol = 4.0*M_PI/3.0*equat_shell*equat_shell*polar_shell;
+    double vol = M_4PI_3*equat_shell*equat_shell*polar_shell;
     return vol;
 }
@@ -60,5 +60,5 @@
 
     for(int i=0;i<N_POINTS_76;i++) {
-        double zi = ( Gauss76Z[i]*(uplim-lolim) + uplim + lolim )/2.0;
+        double zi = 0.5*( Gauss76Z[i]*(uplim-lolim) + uplim + lolim );
         double yyy = Gauss76Wt[i] * gfn4(zi,
                                   radius_equat_core,
@@ -72,5 +72,5 @@
     }
 
-    double answer = (uplim-lolim)/2.0*summ;
+    double answer = 0.5*(uplim-lolim)*summ;
     //convert to [cm-1]
     answer *= 1.0e-4;
@@ -80,5 +80,5 @@
 
 static double
-core_shell_ellipsoid_xt_kernel_2d(double q, double q_x, double q_y,
+core_shell_ellipsoid_xt_kernel_2d(double qx, double qy,
           double radius_equat_core,
           double x_core,
@@ -91,18 +91,9 @@
           double phi)
 {
-    //convert angle degree to radian
-    theta = theta * M_PI_180;
-    phi = phi * M_PI_180;
-
-    // ellipsoid orientation, the axis of the rotation is consistent with the ploar axis.
-    const double cyl_x = sin(theta) * cos(phi);
-    const double cyl_y = sin(theta) * sin(phi);
+    double q, sin_alpha, cos_alpha;
+    ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);
 
     const double sldcs = core_sld - shell_sld;
     const double sldss = shell_sld- solvent_sld;
-
-    // Compute the angle btw vector q and the
-    // axis of the cylinder
-    const double cos_val = cyl_x*q_x + cyl_y*q_y;
 
     const double polar_core = radius_equat_core*x_core;
@@ -112,5 +103,5 @@
     // Call the IGOR library function to get the kernel:
     // MUST use gfn4 not gf2 because of the def of params.
-    double answer = gfn4(cos_val,
+    double answer = gfn4(cos_alpha,
                   radius_equat_core,
                   polar_core,
@@ -160,7 +151,5 @@
           double phi)
 {
-    double q;
-    q = sqrt(qx*qx+qy*qy);
-    double intensity = core_shell_ellipsoid_xt_kernel_2d(q, qx/q, qy/q,
+    double intensity = core_shell_ellipsoid_xt_kernel_2d(qx, qy,
                        radius_equat_core,
                        x_core,
Index: sasmodels/models/ellipsoid.c
===================================================================
--- sasmodels/models/ellipsoid.c	(revision 0d6e86566d51a1fba22933bdbac8c40d36f9bd76)
+++ sasmodels/models/ellipsoid.c	(revision 5bddd89a3ed5b121f80ca5d5663daeb28ce822d8)
@@ -49,12 +49,7 @@
     double phi)
 {
-    double sn, cn;
-
-    const double q = sqrt(qx*qx + qy*qy);
-    SINCOS(phi*M_PI_180, sn, cn);
-    const double cos_alpha = (q==0. ? 1.0 : (cn*qx + sn*qy)*sin(theta*M_PI_180)/q);
-    const double alpha = acos(cos_alpha);
-    SINCOS(alpha, sn, cn);
-    const double form = _ellipsoid_kernel(q, radius_polar, radius_equatorial, sn);
+    double q, sin_alpha, cos_alpha;
+    ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);
+    const double form = _ellipsoid_kernel(q, radius_polar, radius_equatorial, sin_alpha);
     const double s = (sld - sld_solvent) * form_volume(radius_polar, radius_equatorial);
 
Index: sasmodels/models/hollow_cylinder.c
===================================================================
--- sasmodels/models/hollow_cylinder.c	(revision 0d6e86566d51a1fba22933bdbac8c40d36f9bd76)
+++ sasmodels/models/hollow_cylinder.c	(revision 5bddd89a3ed5b121f80ca5d5663daeb28ce822d8)
@@ -1,4 +1,3 @@
 double form_volume(double radius, double thickness, double length);
-
 double Iq(double q, double radius, double thickness, double length, double sld,
 	double solvent_sld);
@@ -9,25 +8,16 @@
 
 // From Igor library
-static double hollow_cylinder_scaling(
-    double integrand, double delrho, double volume)
+static double
+_hollow_cylinder_scaling(double integrand, double delrho, double volume)
 {
-    double answer;
-    // Multiply by contrast^2
-    answer = integrand*delrho*delrho;
-
-    //normalize by cylinder volume
-    answer *= volume*volume;
-
-    //convert to [cm-1]
-    answer *= 1.0e-4;
-
-    return answer;
+    return 1.0e-4 * square(volume * delrho * integrand);
 }
 
 
-static double _hollow_cylinder_kernel(
-    double q, double radius, double thickness, double length, double dum)
+static double
+_hollow_cylinder_kernel(double q,
+    double radius, double thickness, double length, double sin_val, double cos_val)
 {
-    const double qs = q*sqrt(1.0-dum*dum);
+    const double qs = q*sin_val;
     const double lam1 = sas_J1c((radius+thickness)*qs);
     const double lam2 = sas_J1c(radius*qs);
@@ -35,44 +25,10 @@
     //Note: lim_{r -> r_c} psi = J0(radius_core*qs)
     const double psi = (lam1 - gamma_sq*lam2)/(1.0 - gamma_sq);	//SRK 10/19/00
-    const double t2 = sinc(q*length*dum/2.0);
-    return square(psi*t2);
+    const double t2 = sinc(0.5*q*length*cos_val);
+    return psi*t2;
 }
 
-
-static double hollow_cylinder_analytical_2D_scaled(
-    double q, double q_x, double q_y, double radius, double thickness,
-    double length, double sld, double solvent_sld, double theta, double phi)
-{
-    double cyl_x, cyl_y; //, cyl_z
-    //double q_z;
-    double vol, cos_val, delrho;
-    double answer;
-    //convert angle degree to radian
-    theta = theta * M_PI_180;
-    phi = phi * M_PI_180;
-    delrho = solvent_sld - sld;
-
-    // Cylinder orientation
-    cyl_x = sin(theta) * cos(phi);
-    cyl_y = sin(theta) * sin(phi);
-    //cyl_z = -cos(theta) * sin(phi);
-
-    // q vector
-    //q_z = 0;
-
-    // Compute the angle btw vector q and the
-    // axis of the cylinder
-    cos_val = cyl_x*q_x + cyl_y*q_y;// + cyl_z*q_z;
-
-    answer = _hollow_cylinder_kernel(q, radius, thickness, length, cos_val);
-
-    vol = form_volume(radius, thickness, length);
-    answer = hollow_cylinder_scaling(answer, delrho, vol);
-
-    return answer;
-}
-
-
-double form_volume(double radius, double thickness, double length)
+double
+form_volume(double radius, double thickness, double length)
 {
     double v_shell = M_PI*length*((radius+thickness)*(radius+thickness)-radius*radius);
@@ -81,35 +37,38 @@
 
 
-double Iq(double q, double radius, double thickness, double length,
+double
+Iq(double q, double radius, double thickness, double length,
     double sld, double solvent_sld)
 {
-    int i;
-    double lower,upper,zi, inter;		//upper and lower integration limits
-    double summ,answer,delrho;			//running tally of integration
-    double norm,volume;	//final calculation variables
+    const double lower = 0.0;
+    const double upper = 1.0;		//limits of numerical integral
 
-    lower = 0.0;
-    upper = 1.0;		//limits of numerical integral
-
-    summ = 0.0;			//initialize intergral
-    for (i=0;i<76;i++) {
-        zi = ( Gauss76Z[i] * (upper-lower) + lower + upper )/2.0;
-        inter = Gauss76Wt[i] * _hollow_cylinder_kernel(q, radius, thickness, length, zi);
-        summ += inter;
+    double summ = 0.0;			//initialize intergral
+    for (int i=0;i<76;i++) {
+        const double cos_val = 0.5*( Gauss76Z[i] * (upper-lower) + lower + upper );
+        const double sin_val = sqrt(1.0 - cos_val*cos_val);
+        const double inter = _hollow_cylinder_kernel(q, radius, thickness, length,
+                                                     sin_val, cos_val);
+        summ += Gauss76Wt[i] * inter;
     }
 
-    norm = summ*(upper-lower)/2.0;
-    volume = form_volume(radius, thickness, length);
-    delrho = solvent_sld - sld;
-    answer = hollow_cylinder_scaling(norm, delrho, volume);
+    const double Aq = 0.5*summ*(upper-lower);
+    const double volume = form_volume(radius, thickness, length);
+    return _hollow_cylinder_scaling(Aq, solvent_sld - sld, volume);
+}
 
-    return(answer);
+double
+Iqxy(double qx, double qy,
+    double radius, double thickness, double length,
+    double sld, double solvent_sld, double theta, double phi)
+{
+    double q, sin_alpha, cos_alpha;
+    ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha);
+    const double Aq = _hollow_cylinder_kernel(q, radius, thickness, length,
+        sin_alpha, cos_alpha);
+
+    const double vol = form_volume(radius, thickness, length);
+    return _hollow_cylinder_scaling(Aq, solvent_sld-sld, vol);
 }
 
 
-double Iqxy(double qx, double qy, double radius, double thickness,
-    double length, double sld, double solvent_sld, double theta, double phi)
-{
-    const double q = sqrt(qx*qx+qy*qy);
-    return hollow_cylinder_analytical_2D_scaled(q, qx/q, qy/q, radius, thickness, length, sld, solvent_sld, theta, phi);
-}
