Class CGAlgorithmsDD
Implements basic computational geometry algorithms using DD arithmetic.
Inherited Members
Namespace: NetTopologySuite.Algorithm
Assembly: NetTopologySuite.dll
Syntax
public static class CGAlgorithmsDD
Methods
| Edit this page View SourceIntersection(Coordinate, Coordinate, Coordinate, Coordinate)
Computes an intersection point between two lines using DD arithmetic. If the lines are parallel (either identical or separate) a null value is returned.
Declaration
public static Coordinate Intersection(Coordinate p1, Coordinate p2, Coordinate q1, Coordinate q2)
Parameters
| Type | Name | Description |
|---|---|---|
| Coordinate | p1 | An endpoint of line segment 1 |
| Coordinate | p2 | An endpoint of line segment 1 |
| Coordinate | q1 | An endpoint of line segment 2 |
| Coordinate | q2 | An endpoint of line segment 2 |
Returns
| Type | Description |
|---|---|
| Coordinate | An intersection point if one exists, or |
OrientationIndex(Coordinate, Coordinate, Coordinate)
Returns the index of the direction of the point q relative to
a vector specified by p1-p2.
Declaration
public static int OrientationIndex(Coordinate p1, Coordinate p2, Coordinate q)
Parameters
| Type | Name | Description |
|---|---|---|
| Coordinate | p1 | The origin point of the vector |
| Coordinate | p2 | The final point of the vector |
| Coordinate | q | the point to compute the direction to |
Returns
| Type | Description |
|---|---|
| int |
|
OrientationIndex(double, double, double, double, double, double)
Returns the index of the direction of the point q relative to
a vector specified by p1-p2.
Declaration
public static int OrientationIndex(double p1x, double p1y, double p2x, double p2y, double qx, double qy)
Parameters
| Type | Name | Description |
|---|---|---|
| double | p1x | The x-ordinate of the origin point of the vector |
| double | p1y | The y-ordinate of the origin point of the vector |
| double | p2x | The x-ordinate of the final point of the vector |
| double | p2y | The y-ordinate of the final point of the vector |
| double | qx | The x-ordinate of the point to compute the direction to |
| double | qy | The y-ordinate of the point to compute the direction to |
Returns
| Type | Description |
|---|---|
| int |
|
SignOfDet2x2(DD, DD, DD, DD)
Computes the sign of the determinant of the 2x2 matrix with the given entries.
Declaration
public static int SignOfDet2x2(DD x1, DD y1, DD x2, DD y2)
Parameters
| Type | Name | Description |
|---|---|---|
| DD | x1 | |
| DD | y1 | |
| DD | x2 | |
| DD | y2 |
Returns
| Type | Description |
|---|---|
| int |
|