Changeset 232 for trunk/UGeometry.pas
- Timestamp:
- Sep 19, 2018, 2:34:06 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGeometry.pas
r192 r232 97 97 function GetRect: TGRect<T>; 98 98 function EdgeDistance(Polygon: TGPolygon<T>): Double; 99 function GetCenter: T; 99 100 procedure AddPoint(const P: T); 100 101 procedure Clear; … … 164 165 begin 165 166 Result := Points[Index]; 167 end; 168 169 function TGPolygon<T>.GetCenter: T; 170 var 171 I: Integer; 172 begin 173 Result := T.Create(0, 0); 174 for I := 0 to Length(Points) - 1 do 175 Result := Result + Points[I]; 176 Result.X := TypedRound(Result.X / Length(Points)); 177 Result.Y := TypedRound(Result.Y / Length(Points)); 166 178 end; 167 179
Note:
See TracChangeset
for help on using the changeset viewer.