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.Object
Class representing a triangle, by referencing points in a list.- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description int
a
References to points in Delaunay2D.pointsint
ab
References to neighbor trianglesint
b
References to points in Delaunay2D.pointsint
bc
References to neighbor trianglesint
c
References to points in Delaunay2D.pointsint
ca
References to neighbor trianglesdouble[]
m
Center double[]double
r2
Circumcircle 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) void
copyFrom(SweepHullDelaunay2D.Triangle o)
Copy the values from another triangle.(package private) SweepHullDelaunay2D.Orientation
findOrientation(SweepHullDelaunay2D.Triangle oth)
Find the orientation of the triangles to each other.boolean
inCircle(double[] opp)
Test whether a point is within the circumference circle.(package private) boolean
isClockwise(java.util.List<double[]> points)
Verify that the triangle is clockwise(package private) void
makeClockwise(java.util.List<double[]> points)
Make the triangle clockwise(package private) void
replaceEdge(int a, int b, int ol, int ne)
Replace an edge(package private) void
set(int a, int ab, int b, int bc, int c, int ca)
Update the triangle.java.lang.String
toString()
private boolean
updateCircumcircle(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:
toString
in classjava.lang.Object
-
-