Class: Plurimath::Math::Function::PowerBase

Inherits:
TernaryFunction show all
Defined in:
lib/plurimath/math/function/power_base.rb

Instance Attribute Summary

Attributes inherited from TernaryFunction

#parameter_one, #parameter_three, #parameter_two

Instance Method Summary collapse

Methods inherited from TernaryFunction

#==, #class_name, #initialize, #to_asciimath

Constructor Details

This class inherits a constructor from Plurimath::Math::Function::TernaryFunction

Instance Method Details

#to_htmlObject



24
25
26
27
28
29
# File 'lib/plurimath/math/function/power_base.rb', line 24

def to_html
  first_value  = "<i>#{parameter_one.to_html}</i>"
  second_value = "<sub>#{parameter_two.to_html}</sub>"
  third_value  = "<sup>#{parameter_three.to_html}</sup>"
  "#{first_value}#{second_value}#{third_value}"
end

#to_latexObject



16
17
18
19
20
21
22
# File 'lib/plurimath/math/function/power_base.rb', line 16

def to_latex
  first_value  = parameter_one&.to_latex
  second_value = parameter_two&.to_latex
  third_value  = parameter_three&.to_latex
  first_value  = "{#{first_value}}" if parameter_one.is_a?(Formula)
  "#{first_value}_{#{second_value}}^{#{third_value}}"
end

#to_mathml_without_math_tagObject



9
10
11
12
13
14
# File 'lib/plurimath/math/function/power_base.rb', line 9

def to_mathml_without_math_tag
  first_value  = parameter_one&.to_mathml_without_math_tag
  second_value = parameter_two&.to_mathml_without_math_tag
  third_value  = parameter_three&.to_mathml_without_math_tag
  "<msubsup>#{first_value}#{second_value}#{third_value}</msubsup>"
end