00001 // Wild Magic Source Code 00002 // David Eberly 00003 // http://www.geometrictools.com 00004 // Copyright (c) 1998-2007 00005 // 00006 // This library is free software; you can redistribute it and/or modify it 00007 // under the terms of the GNU Lesser General Public License as published by 00008 // the Free Software Foundation; either version 2.1 of the License, or (at 00009 // your option) any later version. The license is available for reading at 00010 // either of the locations: 00011 // http://www.gnu.org/copyleft/lgpl.html 00012 // http://www.geometrictools.com/License/WildMagicLicense.pdf 00013 // The license applies to versions 0 through 4 of Wild Magic. 00014 // 00015 // Version: 4.0.0 (2006/06/28) 00016 00017 #ifndef WM4APPRPLANEFIT3_H 00018 #define WM4APPRPLANEFIT3_H 00019 00020 #include "Wm4FoundationLIB.h" 00021 #include "Wm4Plane3.h" 00022 00023 namespace Wm4 00024 { 00025 00026 // Least-squares fit of a plane to (x,y,f(x,y)) data by using distance 00027 // measurements in the z-direction. The resulting plane is represented by 00028 // z = A*x + B*y + C. The return value is 'false' if the 3x3 coefficient 00029 // matrix in the linear system that defines A, B, and C is (nearly) singular. 00030 // In this case, A, B, and C are returned as MAX_REAL. 00031 template <class Real> WM4_FOUNDATION_ITEM 00032 bool HeightPlaneFit3 (int iQuantity, const Vector3<Real>* akPoint, 00033 Real& rfA, Real& rfB, Real& rfC); 00034 00035 // Least-squares fit of a plane to (x,y,z) data by using distance measurements 00036 // orthogonal to the proposed plane. 00037 template <class Real> WM4_FOUNDATION_ITEM 00038 Plane3<Real> OrthogonalPlaneFit3 (int iQuantity, 00039 const Vector3<Real>* akPoint); 00040 00041 } 00042 00043 #endif