From 1fcbac2b5156baaa23175ca91d241f7c0e2d6ca8 Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Sun, 15 Jun 2025 15:45:08 +0300 Subject: [PATCH] =?UTF-8?q?Coords=20=D0=BF=D1=80=D0=B8=D0=BC=D0=B5=D1=80?= =?UTF-8?q?=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Graphics/Coords/ClusterGen2.pas | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 InstallerSamples/Graphics/Coords/ClusterGen2.pas diff --git a/InstallerSamples/Graphics/Coords/ClusterGen2.pas b/InstallerSamples/Graphics/Coords/ClusterGen2.pas new file mode 100644 index 000000000..91c73a258 --- /dev/null +++ b/InstallerSamples/Graphics/Coords/ClusterGen2.pas @@ -0,0 +1,21 @@ +{$reference Mathnet.Numerics.dll} +uses Mathnet.Numerics; +uses Coords; + +function GenerateCluster(X, Y, spread: real; count: integer): array of Point; +begin + var xx := Generate.Normal(count, X, spread); + var yy := Generate.Normal(count, Y, spread); + Result := ArrGen(count, i -> Pnt(xx[i],yy[i])); +end; + +begin + Window.Title := 'Генерация кластеров'; + var cluster1 := GenerateCluster(5, 3, 0.5, 90); + var cluster2 := GenerateCluster(7, -6, 1.5, 105); + var cluster3 := GenerateCluster(-7, 2, 1, 44); + + DrawPoints(cluster1,3); + DrawPoints(cluster2,3); + DrawPoints(cluster3,PointRadius := 3); +end. \ No newline at end of file