Difference between revisions of "Coefficients Command"

From GeoGebra Manual
Jump to: navigation, search
m (Text replace - "<div class="box info"> 48px|left This page is part of the official manual for print and pdf. For structural reasons normal users can't edit this page. If you found any errors on this page please contact )
(:{{note|1=There's a special mode (for non-polynomials) for the output of the fitting commands eg if <code>f(x) = FitExp(l1)</code> then <code>Coefficients(f)</code> will return the calculated parameters }})
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<noinclude>{{Manual Page|version=4.2}}</noinclude>
+
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|cas=true|function}}
{{command|cas=true|function}}
+
;Coefficients( <Polynomial> )
;Coefficients[ <Polynomial> ]
+
:Yields the list of all coefficients <math>a_k,a_{k-1},\ldots,a_1, a_0</math>  of the polynomial <math>a_kx^k+a_{k-1}x^{k-1}+\cdots+a_1x+a_0</math>.
:Yields the list of all coefficients of the polynomial.
+
:{{example| 1=<div><code><nowiki>Coefficients(x^3 - 3 x^2 + 3 x)</nowiki></code> yields ''{1, -3, 3, 0}'', the list of all coefficients of <math>x^3 - 3 x^2 + 3 x</math>.</div>}}
:{{example| 1=<div><code><nowiki>Coefficients[x^3 - 3 x^2 + 3 x]</nowiki></code> yields ''{1, -3, 3, 0}'', the list of all coefficients of <math>x^3 - 3 x^2 + 3 x</math>.</div>}}
+
:{{note|1=There's a special mode (for non-polynomials) for the output of the fitting commands eg if <code>f(x) = FitExp(l1)</code> then <code>Coefficients(f)</code> will return the calculated parameters  }}  
;Coefficients[ <Conic> ]
+
;Coefficients( <Conic> )
:It returns list <math>\{a, b, c, d, e, f\}</math> for conics in standard form:<br><hr>
+
:Returns the list of the coefficients ''a'', ''b'', ''c'', ''d'', ''e'', ''f'' of a conic in standard form: <math>a\cdot x^2  +  b\cdot y^2 +  c + d\cdot x\cdot y +  e\cdot x  +  f\cdot y  =  0</math>
:<center><small><math>a\cdot x^2  +  b\cdot y^2 +  c + d\cdot x\cdot y +  e\cdot x  +  f\cdot y  =  0</math></small></center><hr>
+
:{{note|1=For a line in implicit form ''l: ax + by + c = 0'' it is possible to obtain the coefficients using the syntax ''x''(''l''), ''y''(''l''), ''z''(''l'').
 
+
::{{example|1= Given <code>line: 3x + 2y - 2 = 0</code>:
:{{hint|1=For a line in implicit form <math>l: ax + by + c = 0</math> it is possible to obtain the coefficients using the syntax <math>x(l), y(l), z(l)</math>.
+
::*<code>x(line)</code> returns 3
::{{example|1= Given <code>l: 3x + 2y - 2 = 0</code>:
+
::*<code>y(line)</code> returns 2
:::<code>x(''l'')</code> returns 3,
+
::*<code>z(line)</code> returns -2}} }}  
:::<code>y(''l'')</code> returns 2 and
 
:::<code>z(''l'')</code> returns -2.}} }}  
 
 
 
 
==CAS Syntax==
 
==CAS Syntax==
;Coefficients[ <Polynomial> ]
+
;Coefficients( <Polynomial> )
 
:Yields the list of all coefficients of the polynomial in the main variable.
 
:Yields the list of all coefficients of the polynomial in the main variable.
:{{example| 1=<div><code><nowiki>Coefficients[x^3 - 3 x^2 + 3 x]</nowiki></code> yields ''{1, -3, 3, 0}'', the list of all coefficients of <math>x^3 - 3 x^2 + 3 x</math>.</div>}}
+
:{{example| 1=<div><code><nowiki>Coefficients(x^3 - 3 x^2 + 3 x)</nowiki></code> yields ''{1, -3, 3, 0}'', the list of all coefficients of <math>x^3 - 3 x^2 + 3 x</math>.</div>}}
;Coefficients[ <Polynomial>, <Variable> ]
+
;Coefficients( <Polynomial>, <Variable> )
 
:Yields the list of all coefficients of the polynomial in the given variable.
 
:Yields the list of all coefficients of the polynomial in the given variable.
 
:{{example| 1=<div>
 
:{{example| 1=<div>
:* <code><nowiki>Coefficients[a^3 - 3 a^2 + 3 a, a]</nowiki></code> yields ''{1, -3, 3, 0}'', the list of all coefficients of <math>a^3 - 3 a^2 + 3 a</math>, and
+
:* <code><nowiki>Coefficients(a^3 - 3 a^2 + 3 a, a)</nowiki></code> yields ''{1, -3, 3, 0}'', the list of all coefficients of <math>a^3 - 3 a^2 + 3 a</math>
:* <code><nowiki>Coefficients[a^3 - 3 a^2 + 3 a, x]</nowiki></code> yields <math>\{a^3 - 3 a^2 + 3 a\}</math>.</div>}}
+
:* <code><nowiki>Coefficients(a^3 - 3 a^2 + 3 a, x)</nowiki></code> yields {''a''³ - 3 ''a''² + 3 ''a''}.</div>}}

Latest revision as of 10:00, 25 September 2019


Coefficients( <Polynomial> )
Yields the list of all coefficients a_k,a_{k-1},\ldots,a_1, a_0 of the polynomial a_kx^k+a_{k-1}x^{k-1}+\cdots+a_1x+a_0.
Example:
Coefficients(x^3 - 3 x^2 + 3 x) yields {1, -3, 3, 0}, the list of all coefficients of x^3 - 3 x^2 + 3 x.
Note: There's a special mode (for non-polynomials) for the output of the fitting commands eg if f(x) = FitExp(l1) then Coefficients(f) will return the calculated parameters
Coefficients( <Conic> )
Returns the list of the coefficients a, b, c, d, e, f of a conic in standard form: a\cdot x^2 + b\cdot y^2 + c + d\cdot x\cdot y + e\cdot x + f\cdot y = 0
Note: For a line in implicit form l: ax + by + c = 0 it is possible to obtain the coefficients using the syntax x(l), y(l), z(l).
Example: Given line: 3x + 2y - 2 = 0:
  • x(line) returns 3
  • y(line) returns 2
  • z(line) returns -2

CAS Syntax

Coefficients( <Polynomial> )
Yields the list of all coefficients of the polynomial in the main variable.
Example:
Coefficients(x^3 - 3 x^2 + 3 x) yields {1, -3, 3, 0}, the list of all coefficients of x^3 - 3 x^2 + 3 x.
Coefficients( <Polynomial>, <Variable> )
Yields the list of all coefficients of the polynomial in the given variable.
Example:
  • Coefficients(a^3 - 3 a^2 + 3 a, a) yields {1, -3, 3, 0}, the list of all coefficients of a^3 - 3 a^2 + 3 a
  • Coefficients(a^3 - 3 a^2 + 3 a, x) yields {a³ - 3 a² + 3 a}.
© 2024 International GeoGebra Institute