skilld u
2010-04-25 20:34:46
is there any way to delete the outliers of a TPA? Like if a point is a certain distance away from the others it would be deleted.
2010-04-25 20:34:46
2010-04-25 20:41:38
From: skilld u
is there any way to delete the outliers of a TPA? Like if a point is a certain distance away from the others it would be deleted.
procedure RemoveTPAL(var TPA: TPointArray; DistC: Integer);
var
i, ii, h: Integer;
arr: TPointArray;
begin
arr := TPA;
TPA := [];
h := High(arr);
for i := 0 to h do
for ii := 0 to h do
if (Distance(arr[i].x, arr[i].y, arr[ii].x, arr[ii].y) < DistC) and (not PointInTPA(arr[ii], TPA)) then
begin
SetLength(TPA, Length(TPA) + 1);
TPA[High(TPA)] := arr[ii];
end;
end;
2010-04-25 20:42:37
For I:=0 To High(TPA) Do
If TPA[I]> 20 Then
tpaSwap(TPA[I], TPA[High(TPA)]);
Bla Bla Shorten TPA?2010-04-25 20:44:35
From: YoHoJo
// * procedure SortATPASize(var a: T2DPointArray; const BigFirst: Boolean); ?
{*******************************************************************************
function RemoveDistTPointArray(x, y, dist: Integer; ThePoints: TPointArray; RemoveHigher: Boolean): TPointArray;
Description: Removes the points that are inside or outside the distance Dist
from the point (x, y) from the TPointArray ThePoints.
*******************************************************************************} ?
For I:=0 To High(TPA) Do
If TPA[I]> 20 Then
tpaSwap(TPA[I], TPA[High(TPA)]);
Bla Bla Shorten TPA?
:]! I DON'T KNOW ANYTHING!
2010-04-25 20:50:57