Sha256: 237cf79651fa1dbb493448dedc21b49bbc0cacabc1c41606498a77a27925900b
Contents?: true
Size: 298 Bytes
Versions: 40
Compression:
Stored size: 298 Bytes
Contents
module Math GOLDEN_PROPORTION = (sqrt(5.0)+1.0)/2.0 end class Numeric # # +gold(power = 1.0)+: golden section ruler # # returns the value of the golden section elevated to the power of # +power+ # #:nodoc: def gold(p = 1.0) self * (Math::GOLDEN_PROPORTION**(p)) end end
Version data entries
40 entries across 40 versions & 1 rubygems