Class PointCloud_d


public class PointCloud_d extends PointCloud<Point_d>
Class representing a collection of points (in dimension d)
Version:
jan 2014
Author:
Luca Castelli Aleardi, Ecole Polytechnique (INF562)
  • Constructor Details

    • PointCloud_d

      public PointCloud_d(int d)
      Create a new empty point cloud
    • PointCloud_d

      public PointCloud_d(int n, int d)
      Create a point cloud of size n
      Parameters:
      n - number of points
    • PointCloud_d

      public PointCloud_d(ArrayList<Point_d> points)
      Create a new point cloud (a copy) from a collection of points
      Parameters:
      a - list of points (stored as an ArrayList)
  • Method Details

    • boundingBox

      public Point_d[] boundingBox()
      Compute the bounding box (enclosing all points)
      Specified by:
      boundingBox in class PointCloud<Point_d>
      Returns:
      Point_3[] the array containing the min and max bounds
    • max

      public Point_d max(int d)
      Return the point with greatest coordinate value (in direction d)
      Specified by:
      max in class PointCloud<Point_d>
      Parameters:
      d - dimension (0 or 1, corresponding to x or y axis)
      Returns:
      Point_2 the greatest point (with greatest d-coordinate)
    • min

      public Point_d min(int d)
      Return the point with smallest coordinate value (in direction d)
      Specified by:
      min in class PointCloud<Point_d>
      Parameters:
      d - dimension (0 or 1, corresponding to x or y axis)
      Returns:
      Point_2 the smallest point (with smallest d-coordinate)
    • pointsInSphere

      public static PointCloud_d pointsInSphere(int n, int d)
      Generate points inside a d-dimensional sphere at random
      Parameters:
      n - the number of points