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 1300 by gezelter, Thu Jun 24 19:06:47 2004 UTC vs.
Revision 1311 by chrisfen, Fri Jun 25 22:16:39 2004 UTC

# Line 78 | Line 78 | int main(int argc, char* argv[]){
78    epsProbe = 1.0;    
79  
80    for (i = 0; i < npts; i++) {
81 <    x = xmin + (xmax-xmin) * (double)i/(double)npts;
81 >    x = xmin + (xmax-xmin) * (double)i/(double)(npts-1);
82  
83      for (j = 0; j < npts; j++) {
84 <      y = ymin + (ymax-ymin) * (double)j/(double)npts;
84 >      y = ymin + (ymax-ymin) * (double)j/(double)(npts-1);
85  
86        for (k = 0; k < npts; k++) {
87 <        z = zmin + (zmax-zmin) * (double)k/(double)npts;
87 >        z = zmin + (zmax-zmin) * (double)k/(double)(npts-1);
88  
89          r = sqrt(x*x + y*y + z*z);
90          costheta = z/r;
91 <        phi = atan(y/x);
91 >        phi = atan2(y,x);
92  
93          sigmaShape = shape->getSigmaAt(costheta, phi);
94          sShape = shape->getSAt(costheta, phi);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines