Difference between revisions of "Coefficients Command"
From GeoGebra Manual
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 ) |
|||
Line 2: | Line 2: | ||
{{command|cas=true|function}} | {{command|cas=true|function}} | ||
;Coefficients[ <Polynomial> ] | ;Coefficients[ <Polynomial> ] | ||
− | :Yields the list of all coefficients of the 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>. |
:{{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[ <Conic> ] | ;Coefficients[ <Conic> ] | ||
− | : | + | :Returns the list <math>\{a, b, c, d, e, f\}</math> for conics 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> |
− | |||
:{{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>. | :{{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>. |
Revision as of 13:20, 27 March 2013
- 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.
- Coefficients[ <Conic> ]
- Returns the list \{a, b, c, d, e, f\} for conics in standard form: a\cdot x^2 + b\cdot y^2 + c + d\cdot x\cdot y + e\cdot x + f\cdot y = 0
- Hint: 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
l: 3x + 2y - 2 = 0
:x(l)
returns 3,y(l)
returns 2 andz(l)
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, andCoefficients[a^3 - 3 a^2 + 3 a, x]
yields \{a^3 - 3 a^2 + 3 a\}.