Package org.tinfour.common
Class NearestEdgeResult
- java.lang.Object
-
- org.tinfour.common.NearestEdgeResult
-
public class NearestEdgeResult extends Object
Provides a minimal set of data elements for the result of a nearest-edge location operation.
-
-
Constructor Summary
Constructors Constructor Description NearestEdgeResult(IQuadEdge edge, double edgeD, double queryX, double queryY, boolean interior)Standard constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetDistanceToEdge()Gets the distance from the query point to the nearest edge.doublegetDistanceToNearestVertex()Gets the distance from the query point to the nearest vertex.IQuadEdgegetEdge()Gets the edge that is nearest to the query point.VertexgetNearestVertex()Gets the vertex nearest the query point.doublegetX()Get the X coordinate of the query pointdoublegetY()Get the Y coordinate of the query pointbooleanisInterior()Indicates whether the query point was inside the convex polygon boundary of the TIN.
-
-
-
Constructor Detail
-
NearestEdgeResult
public NearestEdgeResult(IQuadEdge edge, double edgeD, double queryX, double queryY, boolean interior)
Standard constructor.- Parameters:
edge- the edge that starts with the vertex nearest (x,y)edgeD- the distance of the query point to the edgequeryX- the X coordinate for the query pointqueryY- the Y coordinate for the query pointinterior- indicates that the query point is inside the TIN boundary,
-
-
Method Detail
-
getEdge
public IQuadEdge getEdge()
Gets the edge that is nearest to the query point. The nearest point on that edge may be either of the endpoints of the edge or some point in between. The nearest vertex may not necessarily lie on the edge.If the query point is in the interior of the TIN, it will lie either on the edge or inside the triangle to the left of the edge.
- Returns:
- a valid edge.
-
getDistanceToEdge
public double getDistanceToEdge()
Gets the distance from the query point to the nearest edge. This distance is measured in a perpendicular direction from the edge.- Returns:
- a positive, potentially zero, floating point value.
-
getNearestVertex
public Vertex getNearestVertex()
Gets the vertex nearest the query point.- Returns:
- A valid vertex (never null).
-
getDistanceToNearestVertex
public double getDistanceToNearestVertex()
Gets the distance from the query point to the nearest vertex.- Returns:
- a positive floating point value, potentially zero.
-
getX
public double getX()
Get the X coordinate of the query point- Returns:
- a valid coordinate
-
getY
public double getY()
Get the Y coordinate of the query point- Returns:
- a valid coordinate
-
isInterior
public boolean isInterior()
Indicates whether the query point was inside the convex polygon boundary of the TIN.- Returns:
- true if the query point was inside the TIN; false otherwise
-
-