Module: Math
- Defined in:
- lib/horoscope/overrides/math_override.rb
Overview
Equivalent Java methods overriden for Ruby
Class Method Summary collapse
Class Method Details
.java_mod(x, y) ⇒ Object
11 12 13 14 15 |
# File 'lib/horoscope/overrides/math_override.rb', line 11 def self.java_mod(x,y) return 0 if x == 0 && y != 0 return x%y if (x > 0 && y > 0) || (x<0 && y<0) return x%y - y end |
.toDegrees(angrad) ⇒ Object
7 8 9 |
# File 'lib/horoscope/overrides/math_override.rb', line 7 def self.toDegrees(angrad) angrad * 180.0 / Math::PI end |
.toRadians(angdeg) ⇒ Object
3 4 5 |
# File 'lib/horoscope/overrides/math_override.rb', line 3 def self.toRadians(angdeg) angdeg / 180.0 * Math::PI end |