Class PointCloud_2
- Direct Known Subclasses:
PolyLine_2
Class representing a collection of points (in 2D)
- Version:
- dec 2012
- Author:
- Luca Castelli Aleardi, Ecole Polytechnique (INF562)
-
Field Summary
Fields inherited from class Jcg.geometry.PointCloud
dimension, points -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new empty point cloudPointCloud_2(int n) Create a point cloud of size nPointCloud_2(ArrayList<Point_2> points) Create a new point cloud (a copy) from a collection of points -
Method Summary
Modifier and TypeMethodDescriptionPoint_2[]Compute the bounding box (enclosing all points)max(int d) Return the point with greatest coordinate value (in direction d)min(int d) Return the point with smallest coordinate value (in direction d)static PointCloud_2pointsInCircle(int n) Generate points inside a circle at randomMethods inherited from class Jcg.geometry.PointCloud
add, dimension, listOfPoints, remove, size
-
Constructor Details
-
PointCloud_2
public PointCloud_2()Create a new empty point cloud -
PointCloud_2
public PointCloud_2(int n) Create a point cloud of size n- Parameters:
n- number of points
-
PointCloud_2
-
-
Method Details
-
boundingBox
Compute the bounding box (enclosing all points)- Specified by:
boundingBoxin classPointCloud<Point_2>- Returns:
- Point_2[] the array containing the min and max bounds
-
max
Return the point with greatest coordinate value (in direction d)- Specified by:
maxin classPointCloud<Point_2>- Parameters:
d- dimension (0 or 1, corresponding to x or y axis)- Returns:
- Point_2 the greatest point (with greatest d-coordinate)
-
min
Return the point with smallest coordinate value (in direction d)- Specified by:
minin classPointCloud<Point_2>- Parameters:
d- dimension (0 or 1, corresponding to x or y axis)- Returns:
- Point_2 the smallest point (with smallest d-coordinate)
-
pointsInCircle
Generate points inside a circle at random- Parameters:
n- the number of points
-