Sha256: 297ce31d65943b7bf631f20b6ed9b50fe0ff76d83748a11171316d0a39a8cd93

Contents?: true

Size: 510 Bytes

Versions: 2

Compression:

Stored size: 510 Bytes

Contents

require 'symath/value'
require 'symath/definition/operator'

module SyMath
  class Definition::Xd < Definition::Operator
    def initialize()
      super(:xd)
    end

    def description()
      return 'd(f) - exterior derivative of f'
    end

    def evaluate_call(c)
      vars = SyMath.get_variable(:basis.to_m).row(0)

      return c.args[0].evaluate.d(vars)
    end

    def to_latex(args)
      if !args
        args = @args
      end

      return "\\mathrm{d}(#{args[0].to_latex})"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
symath-0.1.1 lib/symath/definition/xd.rb
symath-0.1.0 lib/symath/definition/xd.rb