Module math

Class SweepHullDelaunay2D

java.lang.Object
de.lmu.ifi.dbs.elki.math.geometry.SweepHullDelaunay2D

public class SweepHullDelaunay2D extends Object
Compute the Convex Hull and/or Delaunay Triangulation, using the sweep-hull approach of David Sinclair. Note: This implementation does not check or handle duplicate points!
Author:
Erich Schubert
  • Constructor Details

    • SweepHullDelaunay2D

      public SweepHullDelaunay2D()
      Constructor.
    • SweepHullDelaunay2D

      public SweepHullDelaunay2D(List<Vector> points)
      Constructor.
      Parameters:
      points - Existing points
  • Method Details

    • add

      public void add(Vector point)
      Add a single point to the list (this does not compute or update the triangulation!)
      Parameters:
      point - Point to add
    • getHull

      public Polygon getHull()
      Get the convex hull only. Note: if you also want the Delaunay Triangulation, you should get that first!
      Returns:
      Convex hull
    • getDelaunay

      public ArrayList<SweepHullDelaunay2D.Triangle> getDelaunay()
      Get the Delaunay triangulation.
      Returns:
      Triangle list
    • quadraticEuclidean

      public static double quadraticEuclidean(Vector v1, Vector v2)
      Squared euclidean distance. 2d.
      Parameters:
      v1 - First vector
      v2 - Second vector
      Returns:
      Quadratic distance
    • main

      public static void main(String[] args)