You've already forked lazarus-ccr
* added overload to T2DIntVector.DistanceTo accepting x y coordinates
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1701 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -45,11 +45,15 @@ type
|
||||
function Length : extended;
|
||||
end;
|
||||
{$else}
|
||||
|
||||
{ T2DIntVector }
|
||||
|
||||
T2DIntVector = object
|
||||
x, y : integer;
|
||||
public
|
||||
constructor Create(Ax, Ay : integer);
|
||||
constructor Create(Ax, Ay : Integer);
|
||||
function DistanceTo(AVector : T2DIntVector) : double;
|
||||
function DistanceTo(Ax, Ay : Integer) : double;
|
||||
function Length : extended;
|
||||
end;
|
||||
{$endif}
|
||||
@ -353,6 +357,11 @@ begin
|
||||
result:=sqrt(sqr(self.x - AVector.x) + sqr(self.y - AVector.y));
|
||||
end;
|
||||
|
||||
function T2DIntVector.DistanceTo(Ax, Ay: Integer): double;
|
||||
begin
|
||||
Result := sqrt(sqr(x - Ax) + sqr(y - Ay));
|
||||
end;
|
||||
|
||||
function T2DIntVector.Length: extended;
|
||||
begin
|
||||
result:=sqrt(sqr(Self.x)+sqr(self.y));
|
||||
|
Reference in New Issue
Block a user