Sha256: 01f42cce9703441f166d70fb45927a3c8cfa71f761b973169ee797a1b4a90922

Contents?: true

Size: 354 Bytes

Versions: 16

Compression:

Stored size: 354 Bytes

Contents

module Dydx
  module Algebra
    module Set
      class Cos < Base
        attr_accessor :x

        def initialize(x)
          @x = x
        end

        def to_s
          "cos( #{x.to_s} )"
        end

        def differentiate(sym=:x)
          -1 * sin(x) * x.d(sym)
        end
        alias_method :d, :differentiate
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dydx-0.1.31 lib/dydx/algebra/set/cos.rb
dydx-0.1.3 lib/dydx/algebra/set/cos.rb
dydx-0.1.29 lib/dydx/algebra/set/cos.rb
dydx-0.1.28 lib/dydx/algebra/set/cos.rb
dydx-0.1.25 lib/dydx/algebra/set/cos.rb
dydx-0.1.2 lib/dydx/algebra/set/cos.rb
dydx-0.1.1 lib/dydx/algebra/set/cos.rb
dydx-0.1.0 lib/dydx/algebra/set/cos.rb
dydx-0.0.9 lib/dydx/algebra/set/cos.rb
dydx-0.0.8 lib/dydx/algebra/set/cos.rb
dydx-0.0.7 lib/dydx/algebra/set/cos.rb
dydx-0.0.6 lib/dydx/algebra/set/cos.rb
dydx-0.0.5 lib/dydx/algebra/set/cos.rb
dydx-0.0.4 lib/dydx/algebra/set/cos.rb
dydx-0.0.3 lib/dydx/algebra/set/cos.rb
dydx-0.0.2 lib/dydx/algebra/set/cos.rb