Changeset 14341
- Timestamp:
- 02/12/13 09:31:32 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/wrappers/ExpSimplify/ExpSimplify.cpp
r14340 r14341 37 37 38 38 /*calculate the shortest distance of all vertices between ind0 and ind1*/ 39 for(int i=ind0;i<ind1 ;i++){40 distance = sqrt((x[i ]-x[i+1])*(x[i]-x[i+1]) + (y[i]-y[i+1])*(y[i]-y[i+1]));39 for(int i=ind0;i<ind1-1;i++){ 40 distance = sqrt((x[ind0]-x[i+1])*(x[ind0]-x[i+1]) + (y[ind0]-y[i+1])*(y[ind0]-y[i+1])); 41 41 if(i==ind0 || distance>maxdistance){ 42 42 maxdistance=distance; 43 index = i ;43 index = i + 1; 44 44 } 45 45 } … … 54 54 * 55 55 * So: beta = <x-x0,xend-x0>/<xend-x0,xend-x0> */ 56 57 for(int i=ind0+1;i< ind1;i++){56 57 for(int i=ind0+1;i<=ind1;i++){ 58 58 beta = ((x[i]-x[ind0])*(x[ind1]-x[ind0]) + (y[i]-y[ind0])*(y[ind1]-y[ind0]))/((x[ind1]-x[ind0])*(x[ind1]-x[ind0])+(y[ind1]-y[ind0])*(y[ind1]-y[ind0])); 59 59 dx = x[i]-beta*x[ind1]+(beta-1.)*x[ind0]; … … 78 78 * (index and ind1)*/ 79 79 _assert_(index!=-1); 80 _assert_(index!=ind1); 81 _assert_(index!=ind0); 80 82 simplify(contour,flags,ind0 ,index,tolerance); 81 83 simplify(contour,flags,index,ind1, tolerance); … … 157 159 /*Start recursive call to simplify*/ 158 160 for(int i=0;i<nods;i++) flags[i]=true; 161 printf("-------------- file: ExpSimplify.cpp line: %i\n",__LINE__); 159 162 simplify(contour,flags,0,nods-1,tolerance); 160 163 }
Note:
See TracChangeset
for help on using the changeset viewer.