Class: Plurimath::Math::Function::Root
- Inherits:
-
BinaryFunction
- Object
- Core
- BinaryFunction
- Plurimath::Math::Function::Root
- Defined in:
- lib/plurimath/math/function/root.rb
Instance Attribute Summary
Attributes inherited from BinaryFunction
#parameter_one, #parameter_two
Instance Method Summary collapse
Methods inherited from BinaryFunction
#==, #class_name, #initialize, #to_asciimath, #to_html
Methods inherited from Core
#class_name, #empty_tag, #insert_t_tag, #nary_attr_value, #omml_parameter, #tag_name, #validate_function_formula
Constructor Details
This class inherits a constructor from Plurimath::Math::Function::BinaryFunction
Instance Method Details
#to_latex ⇒ Object
21 22 23 24 25 |
# File 'lib/plurimath/math/function/root.rb', line 21 def to_latex first_value = parameter_one&.to_latex second_value = parameter_two&.to_latex "\\sqrt[#{first_value}]{#{second_value}}" end |
#to_mathml_without_math_tag ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/plurimath/math/function/root.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 Utility.update_nodes( Utility.ox_element("mroot"), [ second_value, first_value, ], ) end |
#to_omml_without_math_tag ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/plurimath/math/function/root.rb', line 27 def to_omml_without_math_tag rad_element = Utility.ox_element("rad", namespace: "m") pr_element = Utility.ox_element("radPr", namespace: "m") deg_element = Utility.ox_element("deg", namespace: "m") e_element = Utility.ox_element("e", namespace: "m") Utility.update_nodes(e_element, parameter_one.to_omml_without_math_tag) Utility.update_nodes(deg_element, parameter_two.to_omml_without_math_tag) Utility.update_nodes( rad_element, [ (pr_element << Utility.pr_element("ctrl", true, namespace: "m")), deg_element, e_element, ], ) [rad_element] end |