Converts Degrees as Decimal into Degrees/Minutes/Seconds.Unit
QESBPCSMath
Declaration
Procedure Deg2DMS(const Deg: Extended; out Degs, Mins, Secs: Extended; out Sign: ShortInt);
Deg | Degrees as a Float to process. |
Degs | Degrees Component as Output - if 0 then check Sign field. |
Mins | Minutes Component as Output - always >= 0. |
Secs | Seconds Component as Output - always >= 0. |
Sign | -1 if Value is Negative, 0 if Value is Zero, 1 if Value is Positive. |
Category
Arithmetic Routines for Floats
Routines for converting Positions
Implementation
procedure Deg2DMS (const Deg: Extended; out Degs, Mins, Secs: Extended;
out Sign: ShortInt);
var
X: Extended;
begin
Sign := ESBSign (Deg);
Degs := Int (Deg);
X := Frac (Abs (Deg)) * 60;
Mins := Int (X);
Secs := Frac (X) * 60;
End; |
Declaration
Procedure Deg2DMS(const Deg: Extended; out Degs, Mins: Integer; out Secs: Extended; out Sign: ShortInt);Implementation
procedure Deg2DMS (const Deg: Extended; out Degs, Mins: Integer;
out Secs: Extended; out Sign: ShortInt);
var
X: Extended;
begin
Sign := ESBSign (Deg);
Degs := Trunc (Deg);
X := Frac (abs (Deg)) * 60;
Mins := Trunc (X);
Secs := Frac (X) * 60;
End; |
HTML generated by Time2HELP
|
http://www.time2help.com