Package rope.mesh

Class R_Delaunay_Vertex

java.lang.Object
rope.mesh.R_Delaunay_Vertex

public class R_Delaunay_Vertex extends Object
  • Constructor Details

    • R_Delaunay_Vertex

      public R_Delaunay_Vertex(double... coords)
      Constructor.
      Parameters:
      coords - the coordinates
  • Method Details

    • circumcenter

      public static R_Delaunay_Vertex circumcenter(R_Delaunay_Vertex[] simplex)
      Circumcenter of a simplex.
      Parameters:
      simplex - the simplex (as an array of points)
      Returns:
      the circumcenter (a R_Delaunay_Vertex) of simplex
    • content

      public static double content(R_Delaunay_Vertex[] simplex)
      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

      public static R_Delaunay_Vertex cross(R_Delaunay_Vertex[] matrix)
      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

      public static double determinant(R_Delaunay_Vertex[] matrix)
      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

      public static String toString(R_Delaunay_Vertex[] matrix)
      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

      public double angle(R_Delaunay_Vertex p)
      Angle (in radians) between two Pnts (treated as vectors).
      Parameters:
      p - the other DelaunayVertex
      Returns:
      the angle (in radians) between the two Pnts
    • bisector

      public R_Delaunay_Vertex bisector(R_Delaunay_Vertex point)
      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

      public int dimCheck(R_Delaunay_Vertex p)
      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

      public double dot(R_Delaunay_Vertex p)
      Dot product.
      Parameters:
      p - the other R_Delaunay_Vertex
      Returns:
      dot product of this R_Delaunay_Vertex and p
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • extend

      public R_Delaunay_Vertex extend(double... coords)
      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()
      Overrides:
      hashCode in class Object
    • isInside

      public boolean isInside(R_Delaunay_Vertex[] simplex)
      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

      public R_Delaunay_Vertex isOn(R_Delaunay_Vertex[] simplex)
      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

      public R_Delaunay_Vertex isOutside(R_Delaunay_Vertex[] simplex)
      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

      public int[] relation(R_Delaunay_Vertex[] simplex)
      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

      public R_Delaunay_Vertex subtract(R_Delaunay_Vertex p)
      Subtract.
      Parameters:
      p - the other R_Delaunay_Vertex
      Returns:
      a new R_Delaunay_Vertex = this - p
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • to_vec2

      public vec2 to_vec2()
    • vsCircumcircle

      public int vsCircumcircle(R_Delaunay_Vertex[] simplex)
      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