Sha256: 0ac70899424604b25a18b66e70e5d33e7f82a74af40bfa4301ffb70b455c13c1

Contents?: true

Size: 431 Bytes

Versions: 3

Compression:

Stored size: 431 Bytes

Contents

# pops the top item of the +:float+ stack;
# pushes a ValuePoint with its tangent onto the +:float+ stack
#
# *needs:* 1 +:float+
#
# *pushes:* 1 +:float+
#

class FloatTangentInstruction < Instruction
  def preconditions?
    needs :float, 1
  end
  def setup
    @arg1 = @context.pop_value(:float)
  end
  def derive
    @result = ValuePoint.new("float", Math.tan(@arg1))
  end
  def cleanup
    pushes :float, @result
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nudge-0.2.9 lib/instructions/float/float_tangent.rb
nudge-0.2.8 lib/instructions/float/float_tangent.rb
nudge-0.2.7 lib/instructions/float/float_tangent.rb