ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/SHAPES/visualizer.cpp
(Generate patch)

Comparing trunk/SHAPES/visualizer.cpp (file contents):
Revision 1299 by gezelter, Thu Jun 24 15:56:05 2004 UTC vs.
Revision 1315 by chrisfen, Mon Jun 28 23:05:25 2004 UTC

# Line 21 | Line 21 | int main(int argc, char* argv[]){
21    double sigma, s, eps;
22    double rTerm, r6, r12;
23    double energy;
24 +  double range;
25  
26    char* shapeFileName;
27    char* outputFileName;
# Line 60 | Line 61 | int main(int argc, char* argv[]){
61      
62    // grid has a default value (default=51), so it is always given
63    npts = args_info.grid_arg;
64 +  range = args_info.range_arg;
65  
66 <  xmin = -5.0;
67 <  xmax = 5.0;
66 >  xmin = -range;
67 >  xmax = range;
68  
69 <  ymin = -5.0;
70 <  ymax = 5.0;
69 >  ymin = -range;
70 >  ymax = range;
71  
72 <  zmin = -5.0;
73 <  zmax = 5.0;
72 >  zmin = -range;
73 >  zmax = range;
74  
75 +  //sigmaProbe = 2.28;
76 +  //sProbe = 2.28;
77 +  //epsProbe = 0.020269601874;    
78 +  sigmaProbe = 0.0;
79 +  sProbe = 0.0;
80 +  epsProbe = 1.0;    
81 +
82    for (i = 0; i < npts; i++) {
83 <    x = xmin + (xmax-xmin) * (double)i/(double)npts;
83 >    x = xmin + (xmax-xmin) * (double)i/(double)(npts-1);
84  
85      for (j = 0; j < npts; j++) {
86 <      y = ymin + (ymax-ymin) * (double)j/(double)npts;
86 >      y = ymin + (ymax-ymin) * (double)j/(double)(npts-1);
87  
88        for (k = 0; k < npts; k++) {
89 <        z = zmin + (zmax-zmin) * (double)k/(double)npts;
89 >        z = zmin + (zmax-zmin) * (double)k/(double)(npts-1);
90  
91          r = sqrt(x*x + y*y + z*z);
92 <        theta = acos(z/r);
93 <        phi = atan(y/x);
92 >        costheta = z/r;
93 >        phi = atan2(y,x);
94  
95          sigmaShape = shape->getSigmaAt(costheta, phi);
96          sShape = shape->getSAt(costheta, phi);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines