You've already forked lazarus-ccr
LazMapViewer: Extend TRealPoint with methods to convert from/to radians. Issue #38279, patch by regs.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7946 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -10,26 +10,36 @@
|
||||
unit mvTypes;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
{$MODESWITCH ADVANCEDRECORDS}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils;
|
||||
Classes, SysUtils, Math;
|
||||
|
||||
const
|
||||
TILE_SIZE = 256;
|
||||
PALETTE_PAGE = 'Misc';
|
||||
|
||||
Type
|
||||
{ TArea }
|
||||
{ TArea }
|
||||
TArea = record
|
||||
top, left, bottom, right: Int64;
|
||||
end;
|
||||
|
||||
{ TRealPoint }
|
||||
TRealPoint = Record
|
||||
Lon : Double;
|
||||
Lat : Double;
|
||||
public
|
||||
Lon: Double;
|
||||
Lat: Double;
|
||||
private
|
||||
function GetLonRad: Extended;
|
||||
procedure SetLonRad(AValue: Extended);
|
||||
function GetLatRad: Extended;
|
||||
procedure SetLatRad(AValue: Extended);
|
||||
public
|
||||
property LonRad: Extended read GetLonRad write SetLonRad;
|
||||
property LatRad: Extended read GetLatRad write SetLatRad;
|
||||
end;
|
||||
|
||||
{ TRealArea }
|
||||
@ -40,5 +50,25 @@ Type
|
||||
|
||||
implementation
|
||||
|
||||
function TRealPoint.GetLonRad: Extended;
|
||||
begin
|
||||
Result := DegToRad(Self.Lon);
|
||||
end;
|
||||
|
||||
procedure TRealPoint.SetLonRad(AValue: Extended);
|
||||
begin
|
||||
Self.Lon := RadToDeg(AValue);
|
||||
end;
|
||||
|
||||
function TRealPoint.GetLatRad: Extended;
|
||||
begin
|
||||
Result := DegToRad(Self.Lat);
|
||||
end;
|
||||
|
||||
procedure TRealPoint.SetLatRad(AValue: Extended);
|
||||
begin
|
||||
Self.Lat := RadToDeg(AValue);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
Reference in New Issue
Block a user