public class Util
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static java.util.Random |
generator
Random generator
|
static int |
seed |
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static double[] |
compute2DBoundingBox(Jcg.geometry.Point_2[] points)
Compute the 2D bounding box containing all input points
|
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)
|
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)
|
public static int seed
static java.util.Random generator
public static Jcg.geometry.Point_2[] regularPolygonVertices(int k, double r)
r
- the radius of the circlek
- the number of points on the outer cyclepublic static Jcg.geometry.Point_2[] generateRandom2DPoints(int n, double w, double h)
public static Jcg.geometry.Point_3[] generateRandom3DPoints(int n, double w, double l, double h)
public static double[] compute2DBoundingBox(Jcg.geometry.Point_2[] points)
points
- a collection of 2D points (real coordinates)