Package rope.mesh
Class R_Delaunay_Vertex
java.lang.Object
rope.mesh.R_Delaunay_Vertex
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdddouble
Angle (in radians) between two Pnts (treated as vectors).bisector
(R_Delaunay_Vertex point) Perpendicular bisector of two Pnts.static R_Delaunay_Vertex
circumcenter
(R_Delaunay_Vertex[] simplex) Circumcenter of a simplex.static double
content
(R_Delaunay_Vertex[] simplex) Determine the signed content (i.e., area or volume, etc.) of a simplex.double
coord
(int i) static R_Delaunay_Vertex
cross
(R_Delaunay_Vertex[] matrix) Compute generalized cross-product of the rows of a matrix.static double
determinant
(R_Delaunay_Vertex[] matrix) Compute the determinant of a matrix (array of Pnts).int
Check that dimensions match.int
double
Dot product.boolean
extend
(double... coords) Create a new R_Delaunay_Vertex by adding additional coordinates to this R_Delaunay_Vertex.int
hashCode()
boolean
isInside
(R_Delaunay_Vertex[] simplex) Test if this R_Delaunay_Vertex is inside a simplex.isOn
(R_Delaunay_Vertex[] simplex) Test if this R_Delaunay_Vertex is on a simplex.isOutside
(R_Delaunay_Vertex[] simplex) Test if this R_Delaunay_Vertex is outside of simplex.double
Magnitude (as a vector).int[]
relation
(R_Delaunay_Vertex[] simplex) Relation between this DelaunayVertex and a simplex (represented as an array of Pnts).Subtract.to_vec2()
toString()
static String
toString
(R_Delaunay_Vertex[] matrix) Create a String for a matrix.int
vsCircumcircle
(R_Delaunay_Vertex[] simplex) Test relation between this R_Delaunay_Vertex and circumcircle of a simplex.
-
Constructor Details
-
R_Delaunay_Vertex
public R_Delaunay_Vertex(double... coords) Constructor.- Parameters:
coords
- the coordinates
-
-
Method Details
-
circumcenter
Circumcenter of a simplex.- Parameters:
simplex
- the simplex (as an array of points)- Returns:
- the circumcenter (a R_Delaunay_Vertex) of simplex
-
content
Determine the signed content (i.e., area or volume, etc.) of a simplex.- Parameters:
simplex
- the simplex (as an array of Pnts)- Returns:
- the signed content of the simplex
-
cross
Compute generalized cross-product of the rows of a matrix. The result is a DelaunayVertex perpendicular (as a vector) to each row of the matrix. This is not an efficient implementation, but should be adequate for low dimension.- Parameters:
matrix
- the matrix of Pnts (one less row than the DelaunayVertex dimension)- Returns:
- a DelaunayVertex perpendicular to each row DelaunayVertex
- Throws:
IllegalArgumentException
- if matrix is wrong shape
-
determinant
Compute the determinant of a matrix (array of Pnts). This is not an efficient implementation, but should be adequate for low dimension.- Parameters:
matrix
- the matrix as an array of Pnts- Returns:
- the determinnant of the input matrix
- Throws:
IllegalArgumentException
- if dimensions are wrong
-
toString
Create a String for a matrix.- Parameters:
matrix
- the matrix (an array of Pnts)- Returns:
- a String represenation of the matrix
-
add
Add- Parameters:
p
- the other R_Delaunay_Vertex- Returns:
- a new R_Delaunay_Vertex = this + p
-
angle
Angle (in radians) between two Pnts (treated as vectors).- Parameters:
p
- the other DelaunayVertex- Returns:
- the angle (in radians) between the two Pnts
-
bisector
Perpendicular bisector of two Pnts. Works in any dimension. The coefficients are returned as a R_Delaunay_Vertex of one higher dimension (e.g., (A,B,C,D) for an equation of the form Ax + By + Cz + D = 0).- Parameters:
point
- the other point- Returns:
- the coefficients of the perpendicular bisector
-
coord
public double coord(int i) - Returns:
- the specified coordinate of this R_Delaunay_Vertex
- Throws:
ArrayIndexOutOfBoundsException
- for bad coordinate
-
dimCheck
Check that dimensions match.- Parameters:
p
- the DelaunayVertex to check (against this DelaunayVertex)- Returns:
- the dimension of the Pnts
- Throws:
IllegalArgumentException
- if dimension fail to match
-
dimension
public int dimension()- Returns:
- this R_Delaunay_Vertex's dimension.
-
dot
Dot product.- Parameters:
p
- the other R_Delaunay_Vertex- Returns:
- dot product of this R_Delaunay_Vertex and p
-
equals
-
extend
Create a new R_Delaunay_Vertex by adding additional coordinates to this R_Delaunay_Vertex.- Parameters:
coords
- the new coordinates (added on the right end)- Returns:
- a new R_Delaunay_Vertex with the additional coordinates
-
hashCode
public int hashCode() -
isInside
Test if this R_Delaunay_Vertex is inside a simplex.- Parameters:
simplex
- the simplex (an arary of Pnts)- Returns:
- true iff this R_Delaunay_Vertex is inside simplex.
-
isOn
Test if this R_Delaunay_Vertex is on a simplex.- Parameters:
simplex
- the simplex (an array of Pnts)- Returns:
- the simplex R_Delaunay_Vertex that "witnesses" on-ness (or null if not on)
-
isOutside
Test if this R_Delaunay_Vertex is outside of simplex.- Parameters:
simplex
- the simplex (an array of Pnts)- Returns:
- simplex DelaunayVertex that "witnesses" outsideness (or null if not outside)
-
magnitude
public double magnitude()Magnitude (as a vector).- Returns:
- the Euclidean length of this vector
-
relation
Relation between this DelaunayVertex and a simplex (represented as an array of Pnts). Result is an array of signs, one for each vertex of the simplex, indicating the relation between the vertex, the vertex's opposite facet, and this DelaunayVertex.-1 means R_Delaunay_Vertex is on same side of facet 0 means R_Delaunay_Vertex is on the facet +1 means R_Delaunay_Vertex is on opposite side of facet
throws IllegalArgumentExcpetion if the simplex is degenerate- Parameters:
simplex
- an array of Pnts representing a simplex- Returns:
- an array of signs showing relation between this R_Delaunay_Vertex and simplex
-
subtract
Subtract.- Parameters:
p
- the other R_Delaunay_Vertex- Returns:
- a new R_Delaunay_Vertex = this - p
-
toString
-
to_vec2
-
vsCircumcircle
Test relation between this R_Delaunay_Vertex and circumcircle of a simplex.- Parameters:
simplex
- the simplex (as an array of Pnts)- Returns:
- -1, 0, or +1 for inside, on, or outside of circumcircle
-