Qurak

Create a Voronoi diagram

Voorbeeld 3 stappen, op volgorde uitgevoerd in één sessie. Elke stap is tegen de engine uitgevoerd en de uitvoer hieronder is wat hij opleverde.

Stap 1
nf = Nearest[Table[{t Sin[t], t Cos[t]} -> t, {t, 5}]]
Uitvoer
Nearest[{{Sin[1], Cos[1]} -> 1, {2*Sin[2], 2*Cos[2]} -> 2, {3*Sin[3], 3*Cos[3]} -> 3, {4*Sin[4], 4*Cos[4]} -> 4, {5*Sin[5], 5*Cos[5]} -> 5}]
Stap 2
DensityPlot[First[nf[{x, y}]], {x, -5, 5}, {y, -5, 5}]
Uitvoer
-Graphics-
Stap 3
DensityPlot[First[nf[{x, y}]], {x, -5, 5}, {y, -5, 5}, PlotPoints -> 100]
Uitvoer
-Graphics-

Gebruikte functies

Gerelateerde recepten

Alle recepten · Functiereferentie · Gebruik dit vanuit een MCP-client