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

kig

  • sources
  • kde-4.12
  • kdeedu
  • kig
  • misc
cubic-common.h
Go to the documentation of this file.
1 // Copyright (C) 2003 Dominique Devriese <devriese@kde.org>
2 
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
7 
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 // 02110-1301, USA.
17 
18 #ifndef KIG_MISC_CUBIC_COMMON_H
19 #define KIG_MISC_CUBIC_COMMON_H
20 
21 #include "common.h"
22 
23 class Transformation;
24 
31 class CubicCartesianData
32 {
33 public:
34  double coeffs[10];
43  explicit CubicCartesianData();
48  CubicCartesianData( double a000, double a001, double a002,
49  double a011, double a012, double a022,
50  double a111, double a112, double a122,
51  double a222 )
52  {
53  coeffs[0] = a000;
54  coeffs[1] = a001;
55  coeffs[2] = a002;
56  coeffs[3] = a011;
57  coeffs[4] = a012;
58  coeffs[5] = a022;
59  coeffs[6] = a111;
60  coeffs[7] = a112;
61  coeffs[8] = a122;
62  coeffs[9] = a222;
63  }
64  CubicCartesianData( const double incoeffs[10] );
65 
78  static CubicCartesianData invalidData();
84  bool valid() const;
85  /*
86  * normalize mdata with infinity norm of the coefficients = 1
87  */
88  void normalize();
89 };
90 
91 bool operator==( const CubicCartesianData& lhs, const CubicCartesianData& rhs );
92 
99 const CubicCartesianData calcCubicThroughPoints (
100  const std::vector<Coordinate>& points );
101 
102 const CubicCartesianData calcCubicCuspThroughPoints (
103  const std::vector<Coordinate>& points );
104 
105 const CubicCartesianData calcCubicNodeThroughPoints (
106  const std::vector<Coordinate>& points );
107 
108 double calcCubicYvalue ( double x, double ymin, double ymax,
109  int root, CubicCartesianData data,
110  bool& valid, int& numroots );
111 
112 const Coordinate calcCubicLineIntersect( const CubicCartesianData& c,
113  const LineData& l,
114  int root, bool& valid );
115 
116 void calcCubicLineRestriction ( CubicCartesianData data,
117  Coordinate p1, Coordinate dir,
118  double& a, double& b, double& c, double& d );
119 
120 const CubicCartesianData calcCubicTransformation (
121  const CubicCartesianData& data,
122  const Transformation& t, bool& valid );
123 
124 #endif
calcCubicLineIntersect
const Coordinate calcCubicLineIntersect(const CubicCartesianData &c, const LineData &l, int root, bool &valid)
Definition: cubic-common.cc:375
CubicCartesianData::coeffs
double coeffs[10]
Definition: cubic-common.h:34
LineData
Simple class representing a line.
Definition: misc/common.h:49
CubicCartesianData::CubicCartesianData
CubicCartesianData()
Default Constructor.
Definition: cubic-common.cc:32
calcCubicNodeThroughPoints
const CubicCartesianData calcCubicNodeThroughPoints(const std::vector< Coordinate > &points)
Definition: cubic-common.cc:247
calcCubicThroughPoints
const CubicCartesianData calcCubicThroughPoints(const std::vector< Coordinate > &points)
This function calcs a cartesian cubic equation such that the given points are on the cubic...
Definition: cubic-common.cc:58
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
Transformation
Class representing a transformation.
Definition: kigtransform.h:37
CubicCartesianData::CubicCartesianData
CubicCartesianData(double a000, double a001, double a002, double a011, double a012, double a022, double a111, double a112, double a122, double a222)
Constructor.
Definition: cubic-common.h:48
CubicCartesianData::valid
bool valid() const
Return whether this is a valid CubicCartesianData.
Definition: cubic-common.cc:539
calcCubicTransformation
const CubicCartesianData calcCubicTransformation(const CubicCartesianData &data, const Transformation &t, bool &valid)
Definition: cubic-common.cc:438
CubicCartesianData
This class represents an equation of a cubic in the form (in homogeneous coordinates, ), .
Definition: cubic-common.h:31
common.h
calcCubicLineRestriction
void calcCubicLineRestriction(CubicCartesianData data, Coordinate p1, Coordinate dir, double &a, double &b, double &c, double &d)
Definition: cubic-common.cc:395
operator==
bool operator==(const CubicCartesianData &lhs, const CubicCartesianData &rhs)
Definition: cubic-common.cc:524
calcCubicYvalue
double calcCubicYvalue(double x, double ymin, double ymax, int root, CubicCartesianData data, bool &valid, int &numroots)
Definition: cubic-common.cc:345
calcCubicCuspThroughPoints
const CubicCartesianData calcCubicCuspThroughPoints(const std::vector< Coordinate > &points)
Definition: cubic-common.cc:153
CubicCartesianData::normalize
void normalize()
Definition: cubic-common.cc:44
CubicCartesianData::invalidData
static CubicCartesianData invalidData()
Create an invalid CubicCartesianData.
Definition: cubic-common.cc:532
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kig

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal