00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef MATHUTILS_H
00018 #define MATHUTILS_H
00019
00020 #ifndef Q_OS_MACX
00021 #include <cmath>
00022 #else
00023 #include <math.h>
00024 #endif
00025 #include "Vector3D.h"
00026 #include "Point3D.h"
00027
00028
00029 namespace MathUtils
00030 {
00032 bool ANALYSIS_EXPORT calcBarycentricCoordinates( double x, double y, Point3D* p1, Point3D* p2, Point3D* p3, Point3D* result );
00033 bool ANALYSIS_EXPORT BarycentricToXY( double u, double v, double w, Point3D* p1, Point3D* p2, Point3D* p3, Point3D* result );
00035 double ANALYSIS_EXPORT calcBernsteinPoly( int n, int i, double t );
00037 double ANALYSIS_EXPORT cFDerBernsteinPoly( int n, int i, double t );
00039 double ANALYSIS_EXPORT calcCubicHermitePoly( int n, int i, double t );
00041 double ANALYSIS_EXPORT cFDerCubicHermitePoly( int n, int i, double t );
00043 bool ANALYSIS_EXPORT circumcenter( Point3D* p1, Point3D* p2, Point3D* p3, Point3D* result );
00045 double ANALYSIS_EXPORT distPointFromLine( Point3D* thepoint, Point3D* p1, Point3D* p2 );
00047 int ANALYSIS_EXPORT faculty( int n );
00049 bool ANALYSIS_EXPORT inCircle( Point3D* testp, Point3D* p1, Point3D* p2, Point3D* p3 );
00051 bool ANALYSIS_EXPORT inDiametral( Point3D* p1, Point3D* p2, Point3D* point );
00053 double ANALYSIS_EXPORT leftOf( Point3D* thepoint, Point3D* p1, Point3D* p2 );
00055 bool ANALYSIS_EXPORT lineIntersection( Point3D* p1, Point3D* p2, Point3D* p3, Point3D* p4 );
00057 bool ANALYSIS_EXPORT lineIntersection( Point3D* p1, Point3D* p2, Point3D* p3, Point3D* p4, Point3D* intersection_point );
00059 int ANALYSIS_EXPORT lower( int n, int i );
00061 double ANALYSIS_EXPORT max( double x, double y );
00063 double ANALYSIS_EXPORT min( double x, double y );
00065 double ANALYSIS_EXPORT power( double a, int b );
00067 double ANALYSIS_EXPORT triArea( Point3D* pa, Point3D* pb, Point3D* pc );
00069 bool ANALYSIS_EXPORT derVec( const Vector3D* v1, const Vector3D* v2, Vector3D* result, double x, double y );
00071 double ANALYSIS_EXPORT crossVec( Point3D* first, Vector3D* vec1, Point3D* second, Vector3D* vec2 );
00073 bool ANALYSIS_EXPORT normalLeft( Vector3D* v1, Vector3D* result, double length );
00075 bool ANALYSIS_EXPORT normalRight( Vector3D* v1, Vector3D* result, double length );
00077 void ANALYSIS_EXPORT normalFromPoints( Point3D* p1, Point3D* p2, Point3D* p3, Vector3D* vec );
00079 bool ANALYSIS_EXPORT pointInsideTriangle( double x, double y, Point3D* p1, Point3D* p2, Point3D* p3 );
00081 bool ANALYSIS_EXPORT normalMinDistance( Vector3D* tangent, Vector3D* target, Vector3D* result );
00083 double ANALYSIS_EXPORT planeTest( Point3D* test, Point3D* pt1, Point3D* pt2, Point3D* pt3 );
00085 double ANALYSIS_EXPORT angle( Point3D* p1, Point3D* p2, Point3D* p3, Point3D* p4 );
00086 }
00087
00088 #endif