Class Util
java.lang.Object
Util
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]compute2DBoundingBox(Jcg.geometry.Point_2[] points) Compute the 2D bounding box containing all input pointsstatic Jcg.geometry.Point_2[]generateRandom2DPoints(int n, double w, double h) Generate 'n' points at random locations in the plane (in a square of given size WxH)static Jcg.geometry.Point_3[]generateRandom3DPoints(int n, double w, double l, double h) Generate 'n' points at random locations in 3D (in a box of given size WxLxH)static Jcg.geometry.Point_2[]regularPolygonVertices(int k, double r) Return the vertices of a regular polygon (equally spaced on a circle of radius r)
-
Field Details
-
seed
public static int seed -
generator
Random generator
-
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
regularPolygonVertices
public static Jcg.geometry.Point_2[] regularPolygonVertices(int k, double r) Return the vertices of a regular polygon (equally spaced on a circle of radius r)- Parameters:
k- the number of points on the outer cycler- the radius of the circle- Returns:
- Point_2[] an array of 2D points, storing the vertices of a regular polygon
-
generateRandom2DPoints
public static Jcg.geometry.Point_2[] generateRandom2DPoints(int n, double w, double h) Generate 'n' points at random locations in the plane (in a square of given size WxH) -
generateRandom3DPoints
public static Jcg.geometry.Point_3[] generateRandom3DPoints(int n, double w, double l, double h) Generate 'n' points at random locations in 3D (in a box of given size WxLxH) -
compute2DBoundingBox
public static double[] compute2DBoundingBox(Jcg.geometry.Point_2[] points) Compute the 2D bounding box containing all input points- Parameters:
points- a collection of 2D points (real coordinates)
-