Coords примеры
This commit is contained in:
parent
af05f2b3c8
commit
1fcbac2b51
21
InstallerSamples/Graphics/Coords/ClusterGen2.pas
Normal file
21
InstallerSamples/Graphics/Coords/ClusterGen2.pas
Normal file
|
|
@ -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.
|
||||
Loading…
Reference in a new issue