12
down vote
|
I have some functions for hypercube and
n-sphere selection that generate dataframes with cartesian coordinates
and guarantee a uniform distribution through the hypercube or n-sphere
for an arbitrary amount of dimensions :
is in a cube/hypercube of nrDim dimensions with a center and l the length of one side. For an n-sphere with nrDim dimensions, you can do something similar, where r is the radius :
in 2 dimensions, these give :From code :
| ||||||
feedback
|
Cuboid:
Sphere:
Note: edited to include code for sphere | |||||||
feedback
|
A couple of years ago, I made a package called geozoo. It is available on CRAN.
It has many different functions to produce objects in N-dimensions.
One of my favorite ones to watch animate is a cube with points along
its edges, because it was one of the first objects that I made. It also
gives you a sense of distance between vertices.
Also, check out the website: http://streaming.stat.iastate.edu/~dicook/geometric-data/. It contains pictures and downloadable data sets. Hope it meets your needs! |