Lasso Soft Inc. > Home

[lp_math_range360]

Linklp_math_range360
AuthorBil Corry
CategoryMath
Version8.x
LicensePublic Domain
Posted20 Apr 2006
Updated20 Apr 2006
More by this author...

Description

Returns degrees in the range of 0 to 360 given an angle in degrees.

Requires [lp_decimal_precisionset] [lp_math_mod]

Sample Usage

lp_math_deg360: -370;'
'; // 350 lp_math_deg360: -10.222;'
'; // 349.778 lp_math_deg360: 10.222;'
'; // 10.222 lp_math_deg360: 180;'
'; // 180 lp_math_deg360: 360;'
'; // 0 lp_math_deg360: 370.22223;'
'; // 10.22223 lp_math_deg360: 0;'
'; // 0

Source Code

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_range360',
	-description='Returns degrees in the range of 0 to 360 given an angle in degrees.',
	-priority='replace',
	-required='degrees';
	if: (decimal:#degrees) >= 0.0 && (decimal:#degrees) < 360.0;
		return: (lp_decimal_precisionset:(decimal:#degrees));
	else: (decimal:#degrees) < 0.0;
		return: (lp_decimal_precisionset: 360.0 - (lp_math_mod: (math_abs:(decimal:#degrees)),360.0));
	else; // >= 360.0
		return: (lp_decimal_precisionset: (lp_math_mod: (decimal:#degrees),360.0));
	/if;

/define_tag;

]

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft