Wolfram Computation Meets Knowledge

RandomRealPoint

Contributed by: Arnoud Buzing

Randomly choose a point within a specified domain

ResourceFunction["RandomRealPoint"][{range1,range2,}]

generates a random point in the domain defined by the ranges.

ResourceFunction["RandomRealPoint"][ranges,n]

generates n random points on the domain.

ResourceFunction["RandomRealPoint"][ranges,{n1,n2,n3}]

gives an n1×n2×…array of random points.

Details and Options

RandomRealPoint uses RandomReal to generate points with a uniform distribution.
Possible specification of rangei are:
xmax between zero and xmax
{xmin,xmax} in range xminto xmax

Examples

Basic Examples

Find a point within a domain:

In[1]:=
ResourceFunction["RandomRealPoint"][{100, 10, 1}]
Out[1]=

Find many within a four-dimensional domain:

In[2]:=
ResourceFunction["RandomRealPoint"][{20, 10, 10, 100}, 6]
Out[2]=

Create an array of random two-dimensional points in specified domain:

In[3]:=
array = ResourceFunction[
  "RandomRealPoint"][{{-100, 100}, {500, 1000}}, {2, 5}]
Out[3]=

Plot the points on a plane:

In[4]:=
ListPlot[array]
Out[4]=

Scope

Create an array of random three-dimensional points:

In[5]:=
array = ResourceFunction["RandomRealPoint"][{100, 10, 1}, {2, 5}]
Out[5]=

Plot the points as surfaces

In[6]:=
ListPlot3D[array]
Out[6]=

Resource History