Sort 指令
来自GeoGebra Manual
本页为官方文件,一般使用者无法修改,若有任何误谬,请与官方联络。如欲编辑,请至本页的开放版。
- 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.