Module: GuiGeo::Tools
Constant Summary
Constants included from GuiGeo
Instance Method Summary collapse
Methods included from GuiGeo
Instance Method Details
#bound(a, bounded, c) ⇒ Object
13 |
# File 'lib/gui_geometry/tools.rb', line 13 def bound(a,bounded,c) max(a,min(bounded,c)); end |
#max(a, b) ⇒ Object
5 |
# File 'lib/gui_geometry/tools.rb', line 5 def max(a,b) a > b ? a : b; end |
#min(a, b) ⇒ Object
4 |
# File 'lib/gui_geometry/tools.rb', line 4 def min(a,b) a < b ? a : b; end |
#minmax(a, b) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/gui_geometry/tools.rb', line 6 def minmax(a,b) if a <= b return a, b else return b, a end end |