[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob include/vob/opt/Zero1D.hxx src/geom/Quad...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] libvob include/vob/opt/Zero1D.hxx src/geom/Quad... |
Date: |
Thu, 05 Jun 2003 03:57:05 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Changes by: Tuomas J. Lukka <address@hidden> 03/06/05 03:57:05
Modified files:
include/vob/opt: Zero1D.hxx
src/geom : Quadrics.cxx
Log message:
oooops
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/opt/Zero1D.hxx.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/geom/Quadrics.cxx.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: libvob/include/vob/opt/Zero1D.hxx
diff -u libvob/include/vob/opt/Zero1D.hxx:1.1
libvob/include/vob/opt/Zero1D.hxx:1.2
--- libvob/include/vob/opt/Zero1D.hxx:1.1 Thu Jun 5 03:55:10 2003
+++ libvob/include/vob/opt/Zero1D.hxx Thu Jun 5 03:57:05 2003
@@ -8,15 +8,15 @@
*/
template<class F> float findZero1D(const F &f, float low, float high,
float epsx, float epsf,
bool &success) {
- float fl = F(low);
- float fh = F(high);
+ float fl = f(low);
+ float fh = f(high);
if(fl * fh >= 0) {
success = false;
return low;
}
while(fabs(high - low) >= epsx && fabs(fh - fl) >= epsf) {
float mid = lerp(low, high, .5);
- float fm = F(mid);
+ float fm = f(mid);
if(fm * fl >= 0) {
low = mid;
fl = fm;
Index: libvob/src/geom/Quadrics.cxx
diff -u libvob/src/geom/Quadrics.cxx:1.1 libvob/src/geom/Quadrics.cxx:1.2
--- libvob/src/geom/Quadrics.cxx:1.1 Thu Jun 5 03:55:10 2003
+++ libvob/src/geom/Quadrics.cxx Thu Jun 5 03:57:05 2003
@@ -29,11 +29,14 @@
* the s given to us is right and positive and negative otherwise.
*/
float operator()(float s) const {
+ // Point in the scaled problem
+ Vec p(s * point.x, point.y);
+
Vec p0 = centerPoint(s);
return (p0.length() - (p0-p).length());
}
- }
+ };
Vec symmellipse__point_norm(Vec point, Vec normal) {
SymEllProblem prob;
@@ -43,8 +46,9 @@
bool succ;
float scale = Opt::findZero1D(prob, .00001, 10000, .0001, .0001, succ);
- Vec res = prob.centerPoint(s);
- res.x = res.y / s;
+ Vec res = prob.centerPoint(scale);
+ res.x = res.y / scale;
+ return res;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] libvob include/vob/opt/Zero1D.hxx src/geom/Quad...,
Tuomas J. Lukka <=