Class Vertex
java.lang.Object
jaba.Hull.Vertex
A class defining a vertex.
- Version:
- 1.1
- Author:
- Chris Pudney
cpudney@alphapharm.pharm.uwa.edu.au
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Vertex[]Returns the pair of vertices that bound three collinear vertices.static booleanTests whether three vertices are collinear.static VertexcrossProduct(Vertex v1, Vertex v2) Returns the cross product of two vectorsstatic longdistanceSquared(Vertex v1, Vertex v2) Returns the square of the distance between two vertices.static longdotProduct(Vertex v1, Vertex v2) Returns the dot product of two vectorsint[]Get the coordinates of the vertex.longnormSq()Returns the square of the norm of a vectorstatic booleansameVertex(Vertex v1, Vertex v2) Tests whether two vertices are the same point.toString()Returns a string that describes a vertex.static VertexvectorDiff(Vertex v1, Vertex v2) Returns the vector difference between two vertices
-
Constructor Details
-
Vertex
public Vertex()Construct the vertex at (0, 0, 0). -
Vertex
public Vertex(int x, int y, int z) Construct a vertex given a set of coordinates.- Parameters:
x- , y, z The coordinates.
-
-
Method Details
-
getCoords
public int[] getCoords()Get the coordinates of the vertex.- Returns:
- An array of three integers containing the coordinates (x, y, z).
-
sameVertex
-
collinear
-
bounds
-
distanceSquared
-
normSq
public long normSq()Returns the square of the norm of a vector- Returns:
- the square of the norm of this vertex
-
dotProduct
-
vectorDiff
-
crossProduct
-
toString
-