QGIS API Documentation  2.4.0-Chugiak
MathUtils.h File Reference
`#include <cmath>`
`#include "Vector3D.h"`
`#include "Point3D.h"`
Include dependency graph for MathUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

MathUtils

## Functions

bool ANALYSIS_EXPORT MathUtils::calcBarycentricCoordinates (double x, double y, Point3D *p1, Point3D *p2, Point3D *p3, Point3D *result)
Calculates the barycentric coordinates of a point (x,y) with respect to p1, p2, p3 and stores the three barycentric coordinates in 'result'. More...

bool ANALYSIS_EXPORT MathUtils::BarycentricToXY (double u, double v, double w, Point3D *p1, Point3D *p2, Point3D *p3, Point3D *result)

double ANALYSIS_EXPORT MathUtils::calcBernsteinPoly (int n, int i, double t)
calculates the value of a Bernstein polynomial More...

double ANALYSIS_EXPORT MathUtils::cFDerBernsteinPoly (int n, int i, double t)
calculates the first derivative of a Bernstein polynomial with respect to the parameter t More...

double ANALYSIS_EXPORT MathUtils::calcCubicHermitePoly (int n, int i, double t)
calculates the value of a cubic Hermite polynomial More...

double ANALYSIS_EXPORT MathUtils::cFDerCubicHermitePoly (int n, int i, double t)
calculates the first derivative of a cubic Hermite polynomial with respect to the parameter t More...

bool ANALYSIS_EXPORT MathUtils::circumcenter (Point3D *p1, Point3D *p2, Point3D *p3, Point3D *result)
Calculates the center of the circle passing through p1, p2 and p3. More...

double ANALYSIS_EXPORT MathUtils::distPointFromLine (Point3D *thepoint, Point3D *p1, Point3D *p2)
Calculates the (2 dimensional) distance from 'thepoint' to the line defined by p1 and p2. More...

int ANALYSIS_EXPORT MathUtils::faculty (int n)
faculty function More...

bool ANALYSIS_EXPORT MathUtils::inCircle (Point3D *testp, Point3D *p1, Point3D *p2, Point3D *p3)
Tests, whether 'testp' is inside the circle through 'p1', 'p2' and 'p3'. More...

bool ANALYSIS_EXPORT MathUtils::inDiametral (Point3D *p1, Point3D *p2, Point3D *point)
Tests, whether 'point' is inside the diametral circle through 'p1' and 'p2'. More...

double ANALYSIS_EXPORT MathUtils::leftOf (Point3D *thepoint, Point3D *p1, Point3D *p2)
Returns whether 'thepoint' is left or right of the line from 'p1' to 'p2'. More...

bool ANALYSIS_EXPORT MathUtils::lineIntersection (Point3D *p1, Point3D *p2, Point3D *p3, Point3D *p4)
Returns true, if line1 (p1 to p2) and line2 (p3 to p4) intersect. More...

bool ANALYSIS_EXPORT MathUtils::lineIntersection (Point3D *p1, Point3D *p2, Point3D *p3, Point3D *p4, Point3D *intersection_point)
Returns true, if line1 (p1 to p2) and line2 (p3 to p4) intersect. More...

int ANALYSIS_EXPORT MathUtils::lower (int n, int i)
lower function More...

double ANALYSIS_EXPORT MathUtils::max (double x, double y)
returns the maximum of two doubles or the first argument if both are equal More...

double ANALYSIS_EXPORT MathUtils::min (double x, double y)
returns the minimum of two doubles or the first argument if both are equal More...

double ANALYSIS_EXPORT MathUtils::power (double a, int b)
power function for integer coefficients More...

double ANALYSIS_EXPORT MathUtils::triArea (Point3D *pa, Point3D *pb, Point3D *pc)
returns the area of a triangle. More...

bool ANALYSIS_EXPORT MathUtils::derVec (const Vector3D *v1, const Vector3D *v2, Vector3D *result, double x, double y)
Calculates the z-component of a vector with coordinates 'x' and 'y'which is in the same tangent plane as the tangent vectors 'v1' and 'v2'. More...

double ANALYSIS_EXPORT MathUtils::crossVec (Point3D *first, Vector3D *vec1, Point3D *second, Vector3D *vec2)
Calculates the intersection of the two vectors vec1 and vec2, which start at first(vec1) and second(vec2) end. More...

bool ANALYSIS_EXPORT MathUtils::normalLeft (Vector3D *v1, Vector3D *result, double length)
Assigns the vector 'result', which is normal to the vector 'v1', on the left side of v1 and has length 'length'. More...

bool ANALYSIS_EXPORT MathUtils::normalRight (Vector3D *v1, Vector3D *result, double length)
Assigns the vector 'result', which is normal to the vector 'v1', on the right side of v1 and has length 'length'. More...

void ANALYSIS_EXPORT MathUtils::normalFromPoints (Point3D *p1, Point3D *p2, Point3D *p3, Vector3D *vec)
Calculates the normal vector of the plane through the points p1, p2 and p3 and assigns the result to vec. More...

bool ANALYSIS_EXPORT MathUtils::pointInsideTriangle (double x, double y, Point3D *p1, Point3D *p2, Point3D *p3)
Returns true, if the point with coordinates x and y is inside (or at the edge) of the triangle p1,p2,p3 and false, if it is outside. More...

bool ANALYSIS_EXPORT MathUtils::normalMinDistance (Vector3D *tangent, Vector3D *target, Vector3D *result)
Calculates a Vector orthogonal to 'tangent' with length 1 and closest possible to result. More...

double ANALYSIS_EXPORT MathUtils::planeTest (Point3D *test, Point3D *pt1, Point3D *pt2, Point3D *pt3)
Tests, if 'test' is in the same plane as 'p1', 'p2' and 'p3' and returns the z-difference from the plane to 'test. More...

double ANALYSIS_EXPORT MathUtils::angle (Point3D *p1, Point3D *p2, Point3D *p3, Point3D *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored) More...