“Sort 指令”的版本间的差异
来自GeoGebra Manual
(Autogenerated from properties) |
|||
第1行: | 第1行: | ||
− | <noinclude>{{Manual Page|version= | + | <noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|list}} |
− | ;Sort | + | ;Sort( <串列> ) |
− | :{{ | + | :對一個數值、文字或點的 <串列> 進行排序。 |
+ | :{{Note| 點串列以 ''x'' 坐標作為排序依據。}} | ||
+ | :{{Examples|1=<div> | ||
+ | :* <code>Sort({3, 2, 1})</code> 產生串列 ''{1, 2, 3}''。 | ||
+ | :* <code>Sort({"pears", "apples", "figs"})</code> 以英文字母排序產生一個串列。 | ||
+ | :* <code>Sort({(3, 2), (2, 5), (4, 1)}) </code> 產生 ''{(2, 5), (3, 2), (4, 1)}''。</div>}} | ||
+ | |||
+ | ; Sort( <值>, <鍵> ): <值> 串列元素會依據相對應的 < 鍵> 串列元素來進行排序。 | ||
+ | :{{Examples|1=<div> | ||
+ | :* In order to sort a list of polynomials <code>list1 = {x^3, x^2, x^6}</code> according to degree, create the dependent list of degrees <code>list2 = Zip(Degree(a), a, list1)</code>. After that, <code> Sort(list1, list2)</code> yields the requested ''list3 = {x^2, x^3, x^6}''. | ||
+ | :* In order to draw the polygon having as vertices the complex roots of <math>x^{10}-1</math>, sorted by their arguments, create <code>list1 = {ComplexRoot(x^10-1)}</code>, then use the command <code>Polygon(Sort(list1, arg(list1)))</code>. This command yields ''poly1 = 2.94''.</div>}} | ||
+ | |||
+ | {{note|There is a workaround to sort lists of arbitrary objects which is explained in the [[Tutorial:Advanced List Sorting]].}} |
2021年11月11日 (四) 11:07的版本
本頁為官方文件,一般使用者無法修改,若有任何誤謬,請與官方聯絡。如欲編輯,請至本頁的開放版。
- Sort( <串列> )
- 對一個數值、文字或點的 <串列> 進行排序。
- 備註: 點串列以 x 坐標作為排序依據。
- 範例:
Sort({3, 2, 1})
產生串列 {1, 2, 3}。Sort({"pears", "apples", "figs"})
以英文字母排序產生一個串列。Sort({(3, 2), (2, 5), (4, 1)})
產生 {(2, 5), (3, 2), (4, 1)}。
- Sort( <值>, <鍵> )
- <值> 串列元素會依據相對應的 <鍵> 串列元素來進行排序。
- 範例:
- In order to sort a list of polynomials
list1 = {x^3, x^2, x^6}
according to degree, create the dependent list of degreeslist2 = Zip(Degree(a), a, list1)
. After that,Sort(list1, list2)
yields the requested list3 = {x^2, x^3, x^6}. - In order to draw the polygon having as vertices the complex roots of x^{10}-1, sorted by their arguments, create
list1 = {ComplexRoot(x^10-1)}
, then use the commandPolygon(Sort(list1, arg(list1)))
. This command yields poly1 = 2.94.
- In order to sort a list of polynomials
備註: There is a workaround to sort lists of arbitrary objects which is explained in the Tutorial:Advanced List Sorting.