Difference between revisions of "SurdText Command"

From GeoGebra Manual
Jump to: navigation, search
m
(command syntax: changed [ ] into ( ))
 
Line 1: Line 1:
 
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|text}}
 
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|text}}
;SurdText[ <Number> ]
+
;SurdText( <Number> )
 
:Creates text representation of the number in the form <math>\frac{a+b\sqrt{c}}{d}</math>.
 
:Creates text representation of the number in the form <math>\frac{a+b\sqrt{c}}{d}</math>.
 
:{{examples|1=<div>
 
:{{examples|1=<div>
:*<code>SurdText[2.414213562373095]</code> creates ''<math>1 + \sqrt{2}</math>''
+
:*<code>SurdText(2.414213562373095)</code> creates ''<math>1 + \sqrt{2}</math>''
:*<code>SurdText[2.439230484541326]</code> creates ''<math>\frac{7+3 \sqrt{3} }{5}</math>'' </div>}}
+
:*<code>SurdText(2.439230484541326)</code> creates ''<math>\frac{7+3 \sqrt{3} }{5}</math>'' </div>}}
;SurdText[ <Number>, &lt;List> ]
+
;SurdText( <Number>, &lt;List> )
 
:Creates text representation of the number as multiples of the constants in the list. If the list is empty it uses a list of common constants.
 
:Creates text representation of the number as multiples of the constants in the list. If the list is empty it uses a list of common constants.
 
:{{examples|1=<div>
 
:{{examples|1=<div>
:*<code>SurdText[3.718281828459045, {exp(1)}]</code> creates  ''<math>e + 1</math>''
+
:*<code>SurdText(3.718281828459045, {exp(1)})</code> creates  ''<math>e + 1</math>''
:*<code>SurdText[5.382332347441762, {sqrt(2), sqrt(3), sqrt(5)}]</code> creates  ''<math> \sqrt{5} + \sqrt{3} + \sqrt{2}</math>''
+
:*<code>SurdText(5.382332347441762, {sqrt(2), sqrt(3), sqrt(5)})</code> creates  ''<math> \sqrt{5} + \sqrt{3} + \sqrt{2}</math>''
:*<code>SurdText[1.693147180559945, {ln(2)}]</code> creates  ''<math> \ln(2) + 1</math>''</div>}}
+
:*<code>SurdText(1.693147180559945, {ln(2)})</code> creates  ''<math> \ln(2) + 1</math>''</div>}}
;SurdText[ <Point> ]
+
;SurdText( <Point> )
 
:Creates text representation of the point, where coordinates are in the form <math>\frac{a+b\sqrt{c}}{d}</math>.
 
:Creates text representation of the point, where coordinates are in the form <math>\frac{a+b\sqrt{c}}{d}</math>.
:{{example|1=<div><code><nowiki>SurdText[(2.414213562373095, 1.414213562373095)]</nowiki></code> creates ''(<math>1 + \sqrt{2}, \sqrt{2})</math>''</div>}}
+
:{{example|1=<div><code><nowiki>SurdText((2.414213562373095, 1.414213562373095))</nowiki></code> creates ''(<math>1 + \sqrt{2}, \sqrt{2})</math>''</div>}}
  
 
{{Notes|1=<div>
 
{{Notes|1=<div>
Line 19: Line 19:
 
:* Since this command works with a rounded decimal number as input, sometimes the result will be unexpected.
 
:* Since this command works with a rounded decimal number as input, sometimes the result will be unexpected.
 
:* If a suitable answer can't be found, the number will be returned.  
 
:* If a suitable answer can't be found, the number will be returned.  
::{{example|1=<code><nowiki>SurdText[1.23456789012345]</nowiki></code> returns ''1.23456789012345''.}}
+
::{{example|1=<code><nowiki>SurdText(1.23456789012345)</nowiki></code> returns ''1.23456789012345''.}}
 
:*See also the [[FractionText Command|FractionText]] and [[ScientificText Command|ScientificText]] commands.</div>}}
 
:*See also the [[FractionText Command|FractionText]] and [[ScientificText Command|ScientificText]] commands.</div>}}

Latest revision as of 12:08, 3 October 2017


SurdText( <Number> )
Creates text representation of the number in the form \frac{a+b\sqrt{c}}{d}.
Examples:
  • SurdText(2.414213562373095) creates 1 + \sqrt{2}
  • SurdText(2.439230484541326) creates \frac{7+3 \sqrt{3} }{5}
SurdText( <Number>, <List> )
Creates text representation of the number as multiples of the constants in the list. If the list is empty it uses a list of common constants.
Examples:
  • SurdText(3.718281828459045, {exp(1)}) creates e + 1
  • SurdText(5.382332347441762, {sqrt(2), sqrt(3), sqrt(5)}) creates \sqrt{5} + \sqrt{3} + \sqrt{2}
  • SurdText(1.693147180559945, {ln(2)}) creates \ln(2) + 1
SurdText( <Point> )
Creates text representation of the point, where coordinates are in the form \frac{a+b\sqrt{c}}{d}.
Example:
SurdText((2.414213562373095, 1.414213562373095)) creates (1 + \sqrt{2}, \sqrt{2})


Notes:
  • In order to use this command in a Text object, the option LaTeX Formula needs to be enabled in the Text tab of the Menu-options.svg Properties Dialog of the text.
  • Since this command works with a rounded decimal number as input, sometimes the result will be unexpected.
  • If a suitable answer can't be found, the number will be returned.
Example: SurdText(1.23456789012345) returns 1.23456789012345.
© 2024 International GeoGebra Institute