Random 2D Point Cloud Generator
Generate bounded two-dimensional points with their computed axis-aligned bounding box.
Description
Generate 2D points with independently sampled coordinates and a calculated axis-aligned bounding box.
A two-dimensional point has x and y coordinates. Sampling both independently in one interval fills a square; the axis-aligned bounding box then describes the actual generated points rather than necessarily reaching the input bounds.1
The output points array contains [x, y] arrays. boundingBox contains minX, minY, maxX, maxY, width, and height in the coordinate unit. Each point is sampled independently; the points do not describe connected random-walk steps.
When to use Random 2D Point Cloud Generator
Use it for 2D coordinate fixtures or bounding-box exercises inside a common per-axis interval.
How to use Random 2D Point Cloud Generator and understand its results
- Enter integer pointCount from 1 through 128 and finite minimumCoordinate and maximumCoordinate whose absolute values do not exceed 1e100, with minimum no greater than maximum.
- Run and read points in their returned order. The same bounds apply to every 2D coordinate axis.
- Read boundingBox as the extent of this generated set; choose rendering or connections between points separately.
coordinate = minimumCoordinate + randomDraw × (maximumCoordinate − minimumCoordinate) 2 independent draws are consumed per point. Distinct bounds describe a lower-inclusive, upper-exclusive sampling formula, subject to floating-point rounding.
width = maxX − minX; height = maxY − minY The bounding-box calculator scans the generated points for coordinate extremes.
{
"input": {
"pointCount": 3,
"minimumCoordinate": -10,
"maximumCoordinate": 10
},
"randomDraw": 0.25,
"output": {
"boundingBox": {
"minX": -5,
"minY": -5,
"maxX": -5,
"maxY": -5,
"height": 0,
"width": 0
},
"points": [
[
-5,
-5
],
[
-5,
-5
],
[
-5,
-5
]
]
}
} Equal bounds are permitted and fix every coordinate to that value, although draws are still consumed. Repeated points are allowed. Reversed bounds, point counts outside 1–128, and invalid consumed draws fail.
A single point, or several identical points, gives a box with width and height zero. The box need not reach either input bound.
Limitations and assumptions
The default source is Math.random; no seed input or cryptographic entropy guarantee is provided. Repeated runs may select the same result, and the distribution depends on the random source.
There is no uniqueness, minimum separation, integer rounding, fixed radius, sphere/disk sampling, clustering, or topology. No path length, convex hull, or connected segments are returned.
Alternative or Complementary methods
Use the other dimension generator for fixtures in a different coordinate space. A deterministic measurement tool can check explicit coordinates without resampling them.
References
-
Algebra and Trigonometry 2e: The Rectangular Coordinate Systems and Graphs — OpenStax, Rice University
Similar or alternative tools
- Random 3D Point Cloud Generator
Generate independent points in another dimension using a common coordinate interval.
- Bounding Box
Calculate the axis-aligned extent of a supplied 2D point set.