Package elki.math.geometry
Class SweepHullDelaunay2D.Triangle
- java.lang.Object
-
- elki.math.geometry.SweepHullDelaunay2D.Triangle
-
- Enclosing class:
- SweepHullDelaunay2D
public static class SweepHullDelaunay2D.Triangle extends java.lang.ObjectClass representing a triangle, by referencing points in a list.- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description intaReferences to points in Delaunay2D.pointsintabReferences to neighbor trianglesintbReferences to points in Delaunay2D.pointsintbcReferences to neighbor trianglesintcReferences to points in Delaunay2D.pointsintcaReferences to neighbor trianglesdouble[]mCenter double[]doubler2Circumcircle parameters
-
Constructor Summary
Constructors Constructor Description Triangle(int x, int y, int z)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcopyFrom(SweepHullDelaunay2D.Triangle o)Copy the values from another triangle.(package private) SweepHullDelaunay2D.OrientationfindOrientation(SweepHullDelaunay2D.Triangle oth)Find the orientation of the triangles to each other.booleaninCircle(double[] opp)Test whether a point is within the circumference circle.(package private) booleanisClockwise(java.util.List<double[]> points)Verify that the triangle is clockwise(package private) voidmakeClockwise(java.util.List<double[]> points)Make the triangle clockwise(package private) voidreplaceEdge(int a, int b, int ol, int ne)Replace an edge(package private) voidset(int a, int ab, int b, int bc, int c, int ca)Update the triangle.java.lang.StringtoString()private booleanupdateCircumcircle(java.util.List<double[]> points)Recompute the location and squared radius of circumcircle.
-
-
-
Field Detail
-
a
public int a
References to points in Delaunay2D.points
-
b
public int b
References to points in Delaunay2D.points
-
c
public int c
References to points in Delaunay2D.points
-
ab
public int ab
References to neighbor triangles
-
ca
public int ca
References to neighbor triangles
-
bc
public int bc
References to neighbor triangles
-
r2
public double r2
Circumcircle parameters
-
m
public double[] m
Center double[]
-
-
Method Detail
-
replaceEdge
void replaceEdge(int a, int b, int ol, int ne)Replace an edge- Parameters:
a- First pointb- Second pointol- Previous valuene- New value
-
set
void set(int a, int ab, int b, int bc, int c, int ca)Update the triangle.- Parameters:
a- First pointab- Edgeb- Second pointbc- Edgec- Third pointca- Edge
-
inCircle
public boolean inCircle(double[] opp)
Test whether a point is within the circumference circle.- Parameters:
opp- Test double[]- Returns:
- true when contained
-
findOrientation
SweepHullDelaunay2D.Orientation findOrientation(SweepHullDelaunay2D.Triangle oth)
Find the orientation of the triangles to each other.- Parameters:
oth- Other triangle- Returns:
- shared edge
-
makeClockwise
void makeClockwise(java.util.List<double[]> points)
Make the triangle clockwise
-
isClockwise
boolean isClockwise(java.util.List<double[]> points)
Verify that the triangle is clockwise
-
copyFrom
void copyFrom(SweepHullDelaunay2D.Triangle o)
Copy the values from another triangle.- Parameters:
o- object to copy from
-
updateCircumcircle
private boolean updateCircumcircle(java.util.List<double[]> points)
Recompute the location and squared radius of circumcircle.Note: numerical stability is important; and this is not entirely robust to degenerate cases.
Careful: the midpoint of the circumcircle is not the average of the corners!
- Returns:
- success
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-