using GeometricDatasets;
using CairoMakie;
Datasets
Below are some commom datasets from topology.
Spheres
doc
Create a sphere in R^(dim
) with n
points and radius radius
.
Arguments
n::Integer
: the number of points.dim::Integer
: the dimension of the sphere (that is: in which R^dim it is).radius::Number
: the radius of the sphere.noise::Function
: a function such thaty = noise(dim)
is aVector{<:Number}
withsize(y) = (dim;)
.
= sphere(1000; dim = 2, radius = 4);
X scatter(X)
Add some noise
= sphere(1000; dim = 2, noise = x -> rand(x) * 0.2);
X scatter(X)
= sphere(1000; dim = 2, noise = x -> rand(x) * 1);
X scatter(X)
= sphere(1000; dim = 3, noise = x -> rand(x) * 0.3);
X scatter(X)
Cubes
doc
Create a cube in R^(dim``) with
npoints and radius
radius`.
Arguments
n::Integer
: the number of points.dim::Integer
: the dimension of the cube (that is: in which R^dim it is).radius::Number
: the “radius” of the cube, that is, the distance from the center to one of its sides..noise::Function
: a function such thaty = noise(dim)
is aVector{<:Number}
withsize(y) = (dim;)
.
= cube(1000; dim = 2);
X scatter(X)
= cube(500; dim = 3);
X scatter(X)
Torus
doc
torus(n::Integer = 100; r::Number = 1, R::Number = 3)
Arguments
n::Integer
: the number of points.r::Number
: the inner radius.R::Number
: the outer radius.
= torus(1000);
X scatter(X)