Link | lp_math_degToDMS |
Author | Bil Corry |
Category | Math |
Version | 8.x |
License | Public Domain |
Posted | 20 Apr 2006 |
Updated | 02 Sep 2006 |
More by this author... |
Returns Degrees:Minutes:Seconds given an angle in degrees.
Requires [lp_math_range360] [lp_string_pad]
(lp_math_degtodms: 180.508333);
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
[ define_tag:'lp_math_degToDMS', -description='Returns a string of Degrees Minutes Seconds given an angle in decimal degrees.', -priority='replace', -required='degrees',-copy, -optional='delimiter', -encodenone; #degrees = lp_math_range360: #degrees; local:'degree' = (math_floor: #degrees); #degrees -= #degree; local:'minute' = (math_floor: #degrees * 60.0); #degrees -= (#minute / 60.0); local:'second' = (integer: #degrees * 3600.0); if: #minute == 60; #minute = 59; /if; if: #second == 60; #second = 59; /if; if: (local_defined:'delimiter'); return: (lp_string_pad: #degree, 2) (string:#delimiter) (lp_string_pad: #minute, 2) (string:#delimiter) (lp_string_pad: #second, 2); else; return: (lp_string_pad: #degree, 2) '° ' (lp_string_pad: #minute, 2) "' " (lp_string_pad: #second, 2) '"'; /if; /define_tag; ]
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft