We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e67691 commit f36666bCopy full SHA for f36666b
utils/math/geometry.simba
@@ -77,7 +77,7 @@ end;
77
78
function T2DPointArray.InSameTPA(p, q: TPoint): Boolean;
79
var
80
- i: Int32;
+ i: Integer;
81
begin
82
for i := 0 to High(Self) do
83
with Self[i].Bounds() do
@@ -88,13 +88,13 @@ begin
88
end;
89
90
91
-function TPointArray.TotalDistance(): Double;
+function TPointArray.PolylineLength(): Double;
92
93
94
95
- for i := 0 to High(Self) do
96
- if i < High(Self) then
97
- Result += Self[i].DistanceTo(Self[i+1]);
+ if Length(Self) < 2 then Exit;
+ for i := 0 to Length(Self) do
+ Result += Self[i].DistanceTo(Self[i+1]);
98
99
100
0 commit comments