Class Vertex
Models a site (node) in a QuadEdgeSubdivision. The sites can be points on a line string representing a linear site.
The vertex can be considered as a vector with a norm, length, inner product, cross product, etc. Additionally, point relations (e.g., is a point to the left of a line, the circle defined by this point and two others, etc.) are also defined in this class. It is common to want to attach user-defined data to the vertices of a subdivision. One way to do this is to subclass Vertex to carry any desired information.Implements
Inherited Members
Namespace: NetTopologySuite.Triangulate.QuadEdge
Assembly: NetTopologySuite.dll
Syntax
public class Vertex : IEquatable<Vertex>
Constructors
| Edit this page View SourceVertex(Coordinate)
Creates an instance of this class using a clone of the given Coordinate.
Declaration
public Vertex(Coordinate p)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | p | The coordinate |
Vertex(double, double)
Creates an instance of this class using the given x- and y-ordinate valuse
Declaration
public Vertex(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
double | x | x-ordinate value |
double | y | y-ordinate value |
Vertex(double, double, double)
Creates an instance of this class using the given x-, y- and z-ordinate values
Declaration
public Vertex(double x, double y, double z)
Parameters
Type | Name | Description |
---|---|---|
double | x | x-ordinate value |
double | y | y-ordinate value |
double | z | z-ordinate value |
Properties
| Edit this page View SourceCoordinate
Gets the coordinate
Declaration
public Coordinate Coordinate { get; }
Property Value
Type | Description |
---|---|
Coordinate |
X
Gets the x-ordinate value
Declaration
public double X { get; }
Property Value
Type | Description |
---|---|
double |
Y
Gets the y-ordinate value
Declaration
public double Y { get; }
Property Value
Type | Description |
---|---|
double |
Z
Gets the z-ordinate value
Declaration
public double Z { get; set; }
Property Value
Type | Description |
---|---|
double |
Methods
| Edit this page View SourceCircleCenter(Vertex, Vertex)
Computes the centre of the circumcircle of this vertex and two others.
Declaration
public Vertex CircleCenter(Vertex b, Vertex c)
Parameters
Type | Name | Description |
---|---|---|
Vertex | b | |
Vertex | c |
Returns
Type | Description |
---|---|
Vertex | the Coordinate which is the circumcircle of the 3 points. |
CircumRadiusRatio(Vertex, Vertex)
Computes the value of the ratio of the circumradius to shortest edge. If smaller than some given tolerance B, the associated triangle is considered skinny. For an equal lateral triangle this value is 0.57735. The ratio is related to the minimum triangle angle theta by: circumRadius/shortestEdge = 1/(2sin(theta)).
Declaration
public double CircumRadiusRatio(Vertex b, Vertex c)
Parameters
Type | Name | Description |
---|---|---|
Vertex | b | second vertex of the triangle |
Vertex | c | third vertex of the triangle |
Returns
Type | Description |
---|---|
double | ratio of circumradius to shortest edge. |
Classify(Vertex, Vertex)
Declaration
public int Classify(Vertex p0, Vertex p1)
Parameters
Type | Name | Description |
---|---|---|
Vertex | p0 | |
Vertex | p1 |
Returns
Type | Description |
---|---|
int |
Equals(Vertex)
Declaration
public bool Equals(Vertex x)
Parameters
Type | Name | Description |
---|---|---|
Vertex | x |
Returns
Type | Description |
---|---|
bool |
Equals(Vertex, double)
Declaration
public bool Equals(Vertex x, double tolerance)
Parameters
Type | Name | Description |
---|---|---|
Vertex | x | |
double | tolerance |
Returns
Type | Description |
---|---|
bool |
InterpolateZ(Coordinate, Coordinate, Coordinate)
Computes the interpolated Z-value for a point p lying on the segment p0-p1
Declaration
public static double InterpolateZ(Coordinate p, Coordinate p0, Coordinate p1)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | p | The point to interpolate the Z value of |
Coordinate | p0 | A vertex of the segment |
Coordinate | p1 | A vertex of the segment |
Returns
Type | Description |
---|---|
double | The interpolated Z-value (height) of the point |
InterpolateZ(Coordinate, Coordinate, Coordinate, Coordinate)
Interpolates the Z-value (height) of a point enclosed in a triangle whose vertices all have Z values. The containing triangle must not be degenerate (in other words, the three vertices must enclose a non-zero area).
Declaration
public static double InterpolateZ(Coordinate p, Coordinate v0, Coordinate v1, Coordinate v2)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | p | The point to interpolate the Z value of |
Coordinate | v0 | A vertex of a triangle containing the |
Coordinate | v1 | A vertex of a triangle containing the |
Coordinate | v2 | A vertex of a triangle containing the |
Returns
Type | Description |
---|---|
double | The interpolated Z-value (height) of the point |
InterpolateZValue(Vertex, Vertex, Vertex)
For this vertex enclosed in a triangle defined by three vertices v0, v1 and v2, interpolate a z value from the surrounding vertices.
Declaration
public double InterpolateZValue(Vertex v0, Vertex v1, Vertex v2)
Parameters
Type | Name | Description |
---|---|---|
Vertex | v0 | |
Vertex | v1 | |
Vertex | v2 |
Returns
Type | Description |
---|---|
double |
IsInCircle(Vertex, Vertex, Vertex)
Tests if this is inside the circle defined by the points a, b, c. This test uses simple double-precision arithmetic, and thus may not be robust.
Declaration
public bool IsInCircle(Vertex a, Vertex b, Vertex c)
Parameters
Type | Name | Description |
---|---|---|
Vertex | a | A vertex of the triangle |
Vertex | b | A vertex of the triangle |
Vertex | c | A vertex of the triangle |
Returns
Type | Description |
---|---|
bool | true if this vertex is inside the circumcircle (a, b, c) |
MidPoint(Vertex)
returns a new vertex that is mid-way between this vertex and another end point.
Declaration
public Vertex MidPoint(Vertex a)
Parameters
Type | Name | Description |
---|---|---|
Vertex | a | the other end point. |
Returns
Type | Description |
---|---|
Vertex | the point mid-way between this and that. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |