Sha256: aa6857b21a2ace1b9d5b86b099850176e5ac8bd7bb5d4a3836055b5ace3d0c22

Contents?: true

Size: 314 Bytes

Versions: 12

Compression:

Stored size: 314 Bytes

Contents

class Numeric
  
  # Convenience method for converting from radians to a Vec2 vector.
  #
  def radians_to_vec2
    CP::Vec2.new Math::cos(self), Math::sin(self)
  end
  
  # Returns whether the number is close to the given one.
  #
  def close_to? number, e
    self < (number+e) && self > (number-e)
  end
  
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gosu_extensions-0.3.8 lib/extensions/numeric.rb
gosu_extensions-0.3.7 lib/extensions/numeric.rb
gosu_extensions-0.3.6 lib/extensions/numeric.rb
gosu_extensions-0.3.5 lib/extensions/numeric.rb
gosu_extensions-0.3.4 lib/extensions/numeric.rb
gosu_extensions-0.3.3 lib/extensions/numeric.rb
gosu_extensions-0.3.2 lib/extensions/numeric.rb
gosu_extensions-0.3.1 lib/extensions/numeric.rb
gosu_extensions-0.3.0 lib/extensions/numeric.rb
gosu_extensions-0.2.9 lib/extensions/numeric.rb
gosu_extensions-0.2.8 lib/extensions/numeric.rb
gosu_extensions-0.2.7 lib/extensions/numeric.rb