Skip to content

Instantly share code, notes, and snippets.

Created February 18, 2013 19:21
Show Gist options
  • Save anonymous/4979866 to your computer and use it in GitHub Desktop.
Save anonymous/4979866 to your computer and use it in GitHub Desktop.
Misc. Parable Functions
"Various Geometric Conversions"
[ #0.0174532925 * ] 'degrees-to-radians' define
'( degrees - radians )\nConvert degrees to radians' 'degrees-to-radians' describe
[ #0.0174532925 / ] 'radians-to-degrees' define
'( radians - degrees )\nConvert radians to degrees' 'radians-to-degrees' describe
[ #3.14159 ] 'pi' define
'( - number )\nConstant; value for PI' 'pi' describe
[ "diameter" pi * ] 'circumference' define
'( diameter - circumference )\nCalculate the circumference of a circle' 'circumference' describe
[ "radius" dup * pu * ] 'area-of-circle' define
'( radius - area )\nCalculate the area of a circle' 'area-of-circle' describe
[ "base height" * #0.5 * ] 'area-of-triangle' define
'( base height - area )\nCalculate the area of a triangle' 'area-of-triangle' describe
[ "length width" * ] 'area-of-rectangle' define
'( length width - area )\nCalculate the area of a rectangle' 'area-of-rectangle' describe
[ "side" dup * ] 'area-of-square' define
'( side - area )\nCalculate the area of a square' 'area-of-square' describe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment