Geometric Functions (2D)
:Associate with "Geometric Functions (2D)"
More...
Functions |
| GEOMLIBEXPORT int | CheckPointD (const DPOINT2D *start, const DPOINT2D *end, const DPOINT2D *point) |
| GEOMLIBEXPORT int | CheckPointL (const LPOINT2D *start, const LPOINT2D *end, const LPOINT2D *point) |
| int | ClipLineD (const DRECT2D *cliprect, DPOINT2D *start, DPOINT2D *end) |
| ERRVALUE | ComputeSimpleBufferL (const LPOINT2D *ipointlist, int inumpoints, double bufdist, int joinstyle, LPOINT2D **rpointlist, int *rnumpoints) |
| GEOMLIBEXPORT double | DistPointLineSegD (const DPOINT2D *start, const DPOINT2D *end, const DPOINT2D *point, DPOINT2D *closest) |
| GEOMLIBEXPORT double | DistPointLineSegW (const WPOINT2D *start, const WPOINT2D *end, const WPOINT2D *point, DPOINT2D *closest) |
| GEOMLIBEXPORT double | DistPointRectD (const DRECT2D *rect, const DPOINT2D *point, DPOINT2D *closest) |
| GEOMLIBEXPORT int | FindLineInt (const DPOINT2D *line1pt1, const DPOINT2D *line1pt2, const DPOINT2D *line2pt1, const DPOINT2D *line2pt2, DPOINT2D *intpoint) |
| INT32 | MfitPointsBezier (DPOINT2D *In, DPOINT2D **Out, INT32 NumPts, INT32 NumOut, double Tolerance, UINT32 Flags) |
| INT32 | MfitPointsBSpline (DPOINT2D *In, DPOINT2D **Out, INT32 NumPts, int F, double Tolerance, UINT32 Flags) |
| INT32 | MfitPointsBSplineQuadratic (DPOINT2D *In, DPOINT2D **Out, INT32 NumPts, int F, double Tolerance, UINT32 Flags) |
| INT32 | MfitPointsSpline3D (DPOINT3D *In, DPOINT3D **Out, INT32 NumPts, INT32 F, double Tolerance, int SplineType, UINT32 Flags) |
| GEOMLIBEXPORT int | PointInPolyD (const DPOLYGON *polygon, const DPOINT2D *point) |
| GEOMLIBEXPORT int | PointInPolyL (const LPOLYGON *polygon, const LPOINT2D *point) |
| GEOMLIBEXPORT int | SolveLinear (int n, double *A, double *b, double *x) |
| int | SolveLinearSVD (int n, double *A, double *B, double *X) |
Detailed Description
:Associate with "Geometric Functions (2D)"
Function Documentation
Determine point location relative to a line (double coordinates).
- Returns:
- -1 if left of line, 0 if on line, +1 if right of line.
A right-handed cartesian coordinate system is assumed for left/right determination.
- Parameters:
-
| start | Starting point used to define line |
| end | Ending point used to define line |
| point | Point to check |
Determine point location relative to a line (LONG coordinates).
- Returns:
- -1 if left of line, 0 if on line, +1 if right of line.
A right-handed cartesian coordinate system is assumed for left/right determination.
- Parameters:
-
| start | Starting point used to define line |
| end | Ending point used to define line |
| point | Point to check |
Clip line to rectangle (double coordinates).
- Returns:
- 0 - line completely outside cliprect, 1 - line start was modifed, 2 - line end was modified, 3 - both ends were modified, 4 - line completely inside cliprect.
- Parameters:
-
| cliprect | Rectangle to clip to |
| start | Starting point of segment, modified if necessary |
| end | Ending point of segment, modified if necessary |
| ERRVALUE ComputeSimpleBufferL |
( |
const LPOINT2D * |
ipointlist, |
|
|
int |
inumpoints, |
|
|
double |
bufdist, |
|
|
int |
joinstyle, |
|
|
LPOINT2D ** |
rpointlist, |
|
|
int * |
rnumpoints | |
|
) |
| | |
Compute buffer on one side of a polyline.
Note: Consecutive points in the input point list MUST be different. Positive buffer distances will result in a buffer to the right of the line assuming Cartesian coordinates (+ right/up, - left/down).
- Parameters:
-
| rpointlist | Allocated point list returned |
| rnumpoints | Number of points returned |
Determine distance between point and line segment (double coordinates).
- Returns:
- Distance to closest point on line segment.
- Parameters:
-
| start | Starting point of line segment |
| end | Ending point of line segment |
| point | Point to test |
| closest | Closest point on segment returned (NULL if not needed) |
Determine distance between point and line segment (WORD coordinates).
- Returns:
- Distance to closest point on line segment.
- Parameters:
-
| start | Starting point of line segment |
| end | Ending point of line segment |
| point | Point to test |
| closest | Closest point on segment returned (NULL if not needed, DPOINT2D) |
Determine distance between point and rectangle (double coordinates).
- Returns:
- Distance to closest point on rectangle.
- Parameters:
-
| rect | Rectangle to compute distance to |
| point | Point to test |
| closest | Closest point on rectangle returned (NULL if not needed) |
Determine if line segments intersect, where, and type of intersection.
- Returns:
- Type and location of intersection.
Compute Bezier for given point list / 2D - line.
- Returns:
- ret > 0 - number of points in output buffer, ret == 0 - too few lines in input buffer, can't compute spline, but this is not an error. ret < 0 - error code.
Note: Programmer can use the same pointers for input and output buffers. IMPORTANT: Tolerance value will be ALWAYS used to eliminate dup. points!
- Parameters:
-
| In | Input array of points - passed |
| Out | Pointer to output array - returned |
| NumPts | Number of points in input array |
| NumOut | Number of output points |
| Tolerance | Currently used only with SPLINE_UseMinDistance flag minimal allowed distance between points in spline |
| Flags | Processing flags: SPLINE_UseMinDistance - use Tolerance parameter |
Compute cubic B - spline for given point list / 2D - line.
- Returns:
- ret > 0 - number of points in output buffer, ret == 0 - too few lines in input buffer, can't compute spline, but this is not an error. ret < 0 - error code.
Processing flags: SPLINE_UseMinDistance - use Tolerance parameter SPLINE_TreatAsClosed - all non-closed lines will be treated as closed, this flag has no impact on really closed lines. Note: Programmer can use the same pointers for input and output buffers. IMPORTANT: Tolerance value will be ALWAYS used to eliminate dup. points!
- Parameters:
-
| In | Input array of points - passed |
| Out | Pointer to output array - returned |
| NumPts | Number of points in input array |
| F | Number of additional knots between input points |
| Tolerance | Currently used only with SPLINE_UseMinDistance flag minimal allowed distance between points in spline |
| Flags | Flags |
Compute quadratic B - spline for given point list / 2D - line.
- Returns:
- ret > 0 - number of points in output buffer, ret == 0 - too few lines in input buffer, can't compute spline, but this is not an error. ret < 0 - error code.
Note: Programmer can use the same pointers for input and output buffers. IMPORTANT: Tolerance value will be ALWAYS used to eliminate dup. points! Processing flags: SPLINE_UseMinDistance - use Tolerance parameter SPLINE_TreatAsClosed - all non-closed lines will be treated as closed, this flag has no impact on really closed lines.
- Parameters:
-
| In | Input array of points - passed |
| Out | Pointer to output array - returned |
| NumPts | Number of points in input array |
| F | Number of additional knots between input points. |
| Tolerance | Currently used only with SPLINE_UseMinDistance flag minimal allowed distance between points in spline. |
| Flags | Flags |
Compute spline for given point list / 3D - line.
- Returns:
- ret > 0 - number of points in output buffer, ret == 0 - too few lines in input buffer, can't compute spline, but this is not an error. ret < 0 - error code.
NOTE: This function doesn't spline in XY-plane, it's just densify line and splines in Z/distance plane. Note: Programmer can use the same pointers for input and output buffers. IMPORTANT: Tolerance value will be ALWAYS used to eliminate dup. points! Type of the spline to use: SPLINETYPE_Cubic - cubic spline (default type) SPLINETYPE_Quad - quadratic spline SPLINETYPE_Bezier - Bezier spline Processing flags: SPLINE_UseMinDistance - use Tolerance parameter SPLINE_TreatAsClosed - all non-closed lines will be treated as closed, this flag has no impact on really closed lines.
- Parameters:
-
| In | Input array of points - passed |
| Out | Pointer to output array - returned |
| NumPts | Number of points in input array |
| F | Number of additional knots between input points or desired number of points in output (for Bezier) |
| Tolerance | Currently used only with SPLINE_UseMinDistance flag minimal allowed distance between points in spline |
| SplineType | Spline type |
| Flags | Flags |
| GEOMLIBEXPORT int PointInPolyD |
( |
const DPOLYGON * |
polygon, |
|
|
const DPOINT2D * |
point | |
|
) |
| | |
Determine if a point is inside a polygon (double coordinates).
- Returns:
- 0 if point outside, 1 if point inside.
- Parameters:
-
| polygon | Polygon to use |
| point | Point to test |
| GEOMLIBEXPORT int PointInPolyL |
( |
const LPOLYGON * |
polygon, |
|
|
const LPOINT2D * |
point | |
|
) |
| | |
Determine if a point is inside a polygon (LONG coordinates).
- Returns:
- 0 if point outside, 1 if point inside.
- Parameters:
-
| polygon | Polygon to use |
| point | Point to test |
| GEOMLIBEXPORT int SolveLinear |
( |
int |
n, |
|
|
double * |
A, |
|
|
double * |
b, |
|
|
double * |
x | |
|
) |
| | |
Solve general set of linear equations.
Notes: Solve the matrix equation: A * X = B for X Where: A is an NxN matrix, X is a 1xN matrix, B is an Nx1 matrix
- Parameters:
-
| n | Number of equations |
| A | NxN coefficient matrix "A" |
| b | Nx1 result matrix "B" |
| x | 1xN unknown matrix returned "X" |
| int SolveLinearSVD |
( |
int |
n, |
|
|
double * |
A, |
|
|
double * |
B, |
|
|
double * |
X | |
|
) |
| | |
Solve general set of linear equations, using MatSolveSVD().
Notes: Solve the matrix equation: A * X = B for X Where: A is an NxN matrix X is a 1xN matrix B is an Nx1 matrix
- Parameters:
-
| n | Number of equations |
| A | NxN coefficient matrix "A" |
| B | Nx1 result matrix "B" |
| X | 1xN unknown matrix returned "X" |