• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

kig

cubic-common.h

Go to the documentation of this file.
00001 // Copyright (C)  2003  Dominique Devriese <devriese@kde.org>
00002 
00003 // This program is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU General Public License
00005 // as published by the Free Software Foundation; either version 2
00006 // of the License, or (at your option) any later version.
00007 
00008 // This program is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 // GNU General Public License for more details.
00012 
00013 // You should have received a copy of the GNU General Public License
00014 // along with this program; if not, write to the Free Software
00015 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00016 // 02110-1301, USA.
00017 
00018 #ifndef KIG_MISC_CUBIC_COMMON_H
00019 #define KIG_MISC_CUBIC_COMMON_H
00020 
00021 #include "common.h"
00022 
00023 class Transformation;
00024 
00031 class CubicCartesianData
00032 {
00033 public:
00034   double coeffs[10];
00043   explicit CubicCartesianData();
00048   CubicCartesianData( double a000, double a001, double a002,
00049                       double a011, double a012, double a022,
00050                       double a111, double a112, double a122,
00051                       double a222 )
00052     {
00053       coeffs[0] = a000;
00054       coeffs[1] = a001;
00055       coeffs[2] = a002;
00056       coeffs[3] = a011;
00057       coeffs[4] = a012;
00058       coeffs[5] = a022;
00059       coeffs[6] = a111;
00060       coeffs[7] = a112;
00061       coeffs[8] = a122;
00062       coeffs[9] = a222;
00063     }
00064   CubicCartesianData( const double incoeffs[10] );
00065 
00078   static CubicCartesianData invalidData();
00084   bool valid() const;
00085   /*
00086    * normalize mdata with infinity norm of the coefficients = 1
00087    */
00088   void normalize();
00089 };
00090 
00091 bool operator==( const CubicCartesianData& lhs, const CubicCartesianData& rhs );
00092 
00099 const CubicCartesianData calcCubicThroughPoints (
00100     const std::vector<Coordinate>& points );
00101 
00102 const CubicCartesianData calcCubicCuspThroughPoints (
00103     const std::vector<Coordinate>& points );
00104 
00105 const CubicCartesianData calcCubicNodeThroughPoints (
00106     const std::vector<Coordinate>& points );
00107 
00108 double calcCubicYvalue ( double x, double ymin, double ymax,
00109                          int root, CubicCartesianData data,
00110                          bool& valid, int& numroots );
00111 
00112 const Coordinate calcCubicLineIntersect( const CubicCartesianData& c,
00113                                          const LineData& l,
00114                                          int root, bool& valid );
00115 
00116 void calcCubicLineRestriction ( CubicCartesianData data,
00117          Coordinate p1, Coordinate dir,
00118          double& a, double& b, double& c, double& d );
00119 
00120 const CubicCartesianData calcCubicTransformation (
00121   const CubicCartesianData& data,
00122   const Transformation& t, bool& valid );
00123 
00124 #endif

kig

Skip menu "kig"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal