Package pointgon
Class Edge
java.lang.Object
pointgon.Edge
- All Implemented Interfaces:
Serializable
,Comparable<Edge>
Class for the edges of a triangulation of a pointgon.
- Since:
- 2005.02.18 (Christian Borgelt)
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Compare two edges by their weight.double
distance
(double x, double y) Compute the distance of the edge to a given vertex.double
Compute the distance of the edge to a given vertex.boolean
Check whether the edge intersects a given edge.boolean
Check whether the edge intersects the given edge.double
length()
Get the length of the edge.boolean
Check whether the edge meets a given edge.boolean
Check whether the edge meets the given edge.toString()
Create a string description of an edge.
-
Field Details
-
id
protected int idedge identifier -
src
source vertex -
dst
destination vertex -
wgt
protected double wgtweight/length of the edge
-
-
Constructor Details
-
Edge
Create an edge.- Parameters:
src
- the source vertexdst
- the destination vertex- Since:
- 2005.02.18 (Christian Borgelt)
-
Edge
Create an edge.- Parameters:
src
- the source vertexdst
- the destination vertexwgt
- the weight / length of the edge- Since:
- 2005.02.18 (Christian Borgelt)
-
-
Method Details
-
length
public double length()Get the length of the edge.- Returns:
- the length of the edge
- Since:
- 2005.02.18 (Christian Borgelt)
-
meets
Check whether the edge meets a given edge.- Parameters:
edge
- the edge to check- Returns:
- whether the edge meets the given edge
- Since:
- 2005.02.18 (Christian Borgelt)
-
meets
Check whether the edge meets the given edge.- Parameters:
src
- the source vertex of the edge to checkdst
- the destination vertex of the edge to check- Returns:
- whether the edge meets the given edge
- Since:
- 2005.02.18 (Christian Borgelt)
-
isects
Check whether the edge intersects a given edge.- Parameters:
edge
- the edge to check- Returns:
- whether the edge intersects the given edge
- Since:
- 2005.02.18 (Christian Borgelt)
-
isects
Check whether the edge intersects the given edge.- Parameters:
src
- the source vertex of the edge to checkdst
- the destination vertex of the edge to check- Returns:
- whether the edge intersects the given edge
- Since:
- 2005.02.18 (Christian Borgelt)
-
distance
Compute the distance of the edge to a given vertex.- Parameters:
v
- the vertex to which to compute the distance- Returns:
- the distance of the edge to a given vertex
- Since:
- 2005.02.18 (Christian Borgelt)
-
distance
public double distance(double x, double y) Compute the distance of the edge to a given vertex.- Parameters:
x
- the x-coordinate of the vertexy
- the y-coordinate of the vertex- Returns:
- the distance of the edge to a given vertex
- Since:
- 2005.02.18 (Christian Borgelt)
-
compareTo
Compare two edges by their weight.- Specified by:
compareTo
in interfaceComparable<Edge>
- Parameters:
obj
- the edge to compare to- Since:
- 2005.02.18 (Christian Borgelt)
-
toString
Create a string description of an edge.
-