Changeset 385
- Timestamp:
- 08/19/08 19:37:01 (3 months ago)
- Files:
-
- 1 modified
-
trunk/matml/src/ternary/qhull.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/matml/src/ternary/qhull.c
r383 r385 125 125 double vG=x2*y3-x3*y2; 126 126 slope2 = (xG*y3-x3*yG)/vG; 127 slope3 = (x G*y2-x2*yG)/vG;127 slope3 = (x2*yG-xG*y2)/vG; 128 128 129 129 printf (" corners: %g %g %g %g %g %g %g %g %g\n slopes: %g %g\n", … … 146 146 current.C2>=0. && current.C3>=0. && current.C2+current.C3<=1.) 147 147 { 148 double dC2, dC3 ;148 double dC2, dC3, det; 149 149 150 150 /*+ Calculate the energy derivatives +*/ … … 152 152 153 153 /*+ Subtract the facet slopes from the energy derivatives +*/ 154 current.G2 += slope2;155 current.G3 += slope3;154 current.G2 -= slope2; 155 current.G3 -= slope3; 156 156 157 157 /*+ Solve the linear system to estimate the vector to the minimum +*/ 158 d C3= current.G22*current.G33 - current.G23*current.G23;159 dC2 = (current.G3*current.G23 - current.G2*current.G33) / d C3;160 dC3 = (current.G2*current.G23 - current.G3*current.G22) / d C3;158 det = current.G22*current.G33 - current.G23*current.G23; 159 dC2 = (current.G3*current.G23 - current.G2*current.G33) / det; 160 dC3 = (current.G2*current.G23 - current.G3*current.G22) / det; 161 161 162 162 /*+ Add that vector to the point +*/