Changeset 93 for trunk/Packages/Common
- Timestamp:
- Sep 26, 2022, 10:39:03 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UGeometric.pas
r86 r93 8 8 type 9 9 TPointArray = array of TPoint; 10 11 { TVector } 12 13 TVector = record 14 Position: TPoint; 15 Direction: TPoint; 16 function GetLength: Integer; 17 function GetAngle: Double; 18 end; 10 19 11 20 function Distance(P1, P2: TPoint): Integer; … … 162 171 end; 163 172 173 { TVector } 174 175 function TVector.GetLength: Integer; 176 begin 177 Result := Trunc(Sqrt(Sqr(Direction.X) + Sqr(Direction.Y))); 178 end; 179 180 function TVector.GetAngle: Double; 181 begin 182 Result := ArcTan2(Direction.Y, Direction.X); 183 end; 164 184 165 185 end.
Note:
See TracChangeset
for help on using the changeset viewer.