859
884
<term><synopsis>a>=b</synopsis></term>
861
<para>Operátor větší nebo rovno, vrací <constant>true</constant> (pravda) v případě, že <varname>a</varname> je větší než nebo se rovná <varname>b</varname>, jinak vrací <constant>false</constant> (nepravda).</para>
887
Greater than or equal operator,
888
returns <constant>true</constant> if <varname>a</varname> is
889
greater than or equal to
890
<varname>b</varname> else returns <constant>false</constant>.
891
These can be chained as in <userinput>a >= b >= c</userinput>
892
(can also be combine with the greater than operator).
898
<term><synopsis>a<b</synopsis></term>
902
returns <constant>true</constant> if <varname>a</varname> is
903
less than or equal to
904
<varname>b</varname> else returns <constant>false</constant>.
905
These can be chained as in <userinput>a < b < c</userinput>
906
(can also be combine with the less than or equal to operator).
913
<term><synopsis>a>b</synopsis></term>
916
Greater than operator,
917
returns <constant>true</constant> if <varname>a</varname> is
918
greater than or equal to
919
<varname>b</varname> else returns <constant>false</constant>.
920
These can be chained as in <userinput>a > b > c</userinput>
921
(can also be combine with the greater than or equal to operator).
1297
1380
</programlisting> bude vracet funkci, která při zavolání přičte 5 ke svému argumentu. Lokální kopie <varname>k</varname> byla vytvořena ve chvíli, kdy byla funkce definována.</para>
1298
<para>Když chcete, aby funkce neměla žádný privátní slovník, tak vložte za seznam argumentů prázdné hranaté závorky. V takovém případě nebude vytvořen vůbec žádný privátní slovník. To je dobré pro zvýšení efektivity v situacích, kdy žádný privátní slovník není zapotřebí nebo když chcete, aby funkce hledala všechny proměnné takové, jaké jsou v okamžiku volání. Například předpokládejme že chcete, aby funkce vracená funkcí <function>f</function> viděla hodnotu <varname>n</varname> z nejvyšší úrovně, přestože existuje lokální proměnná stejného jména během definování. Potom kód <programlisting>function f() = (
1382
When you want the function to not have any private dictionary
1383
then put empty square brackets after the argument list. Then
1384
no private dictionary will be created at all. Doing this is
1385
good to increase efficiency when a private dictionary is not
1386
needed or when you want the function to lookup all variables
1387
as it sees them when called. For example suppose you want
1388
the function returned from <function>f</function> to see
1389
the value of <varname>k</varname> from the toplevel despite
1390
there being a local variable of the same name during definition.
1392
<programlisting>function f() = (
1300
1394
function r(x) [] = (x+k);
4818
4956
</varlistentry>
4958
<varlistentry id="gel-function-BesselJ0">
4959
<term>BesselJ0</term>
4961
<synopsis>BesselJ0 (x)</synopsis>
4962
<para>Bessel function of the first kind of order 0. Only implemented for real numbers.</para>
4965
<ulink url="http://en.wikipedia.org/wiki/Bessel_functions">Wikipedia</ulink> for more information.
4970
<varlistentry id="gel-function-BesselJ1">
4971
<term>BesselJ1</term>
4973
<synopsis>BesselJ1 (x)</synopsis>
4974
<para>Bessel function of the first kind of order 1. Only implemented for real numbers.</para>
4977
<ulink url="http://en.wikipedia.org/wiki/Bessel_functions">Wikipedia</ulink> for more information.
4982
<varlistentry id="gel-function-BesselJn">
4983
<term>BesselJn</term>
4985
<synopsis>BesselJn (n,x)</synopsis>
4986
<para>Bessel function of the first kind of order <varname>n</varname>. Only implemented for real numbers.</para>
4989
<ulink url="http://en.wikipedia.org/wiki/Bessel_functions">Wikipedia</ulink> for more information.
4994
<varlistentry id="gel-function-BesselY0">
4995
<term>BesselY0</term>
4997
<synopsis>BesselY0 (x)</synopsis>
4998
<para>Bessel function of the second kind of order 0. Only implemented for real numbers.</para>
5001
<ulink url="http://en.wikipedia.org/wiki/Bessel_functions">Wikipedia</ulink> for more information.
5006
<varlistentry id="gel-function-BesselY1">
5007
<term>BesselY1</term>
5009
<synopsis>BesselY1 (x)</synopsis>
5010
<para>Bessel function of the second kind of order 1. Only implemented for real numbers.</para>
5013
<ulink url="http://en.wikipedia.org/wiki/Bessel_functions">Wikipedia</ulink> for more information.
5018
<varlistentry id="gel-function-BesselYn">
5019
<term>BesselYn</term>
5021
<synopsis>BesselYn (n,x)</synopsis>
5022
<para>Bessel function of the second kind of order <varname>n</varname>. Only implemented for real numbers.</para>
5025
<ulink url="http://en.wikipedia.org/wiki/Bessel_functions">Wikipedia</ulink> for more information.
4820
5030
<varlistentry id="gel-function-DirichletKernel">
4821
5031
<term>DirichletKernel</term>
5470
5696
<sect1 id="genius-gel-function-list-plotting">
5471
5697
<title>Vykreslování</title>
5699
<varlistentry id="gel-function-ExportPlot">
5700
<term>ExportPlot</term>
5702
<synopsis>ExportPlot (file,type)</synopsis>
5703
<synopsis>ExportPlot (file)</synopsis>
5705
Export the contents of the plotting window to a file.
5706
The type is a string that specifies the file type to
5707
use, "png", "eps", or "ps". If the type is not
5708
specified, then it is taken to be the extension, in
5709
which case the extension must be ".png", ".eps", or ".ps".
5712
Note that files are overwritten without asking.
5715
On successful export, true is returned. Otherwise
5716
error is printed and exception is raised.
5720
<screen><prompt>genius></prompt> <userinput>ExportPlot("file.png")</userinput>
5721
<prompt>genius></prompt> <userinput>ExportPlot("/directory/file","eps")</userinput>
5473
5727
<varlistentry id="gel-function-LinePlot">
5474
5728
<term>LinePlot</term>
5497
5751
<synopsis>LinePlotDrawLine (x1,y1,x2,y2,…)</synopsis>
5498
5752
<synopsis>LinePlotDrawLine (v,…)</synopsis>
5499
<para>Vykreslit čáru z <varname>x1</varname>,<varname>y1</varname> do <varname>x2</varname>,<varname>y2</varname>. <varname>x1</varname>,<varname>y1</varname>, <varname>x2</varname>,<varname>y2</varname> může být pro delší čáry nahrazeno maticí <varname>n</varname> krát 2.</para>
5754
Draw a line from <varname>x1</varname>,<varname>y1</varname> to
5755
<varname>x2</varname>,<varname>y2</varname>.
5756
<varname>x1</varname>,<varname>y1</varname>,
5757
<varname>x2</varname>,<varname>y2</varname> can be replaced by an
5758
<varname>n</varname> by 2 matrix for a longer polyline.
5500
5760
<para>Lze přidat doplňující parametry pro určení barvy čáry, tloušťky čáry, vykreslovacího okna a šipek. Dělá se to přidáním řetězce <userinput>"color"</userinput>, <userinput>"thickness"</userinput>, <userinput>"window"</userinput> nebo <userinput>"arrow"</userinput> následovaného barvou jako řetězec, tloušťkou jako celé číslo, oknem jako 4prvkový vektor a pro šipku buď <userinput>"origin"</userinput> (v počátku), <userinput>"end"</userinput> (na konci), <userinput>"both"</userinput> (na obou stranách) <userinput>"none"</userinput> (nikde). Pro <userinput>"window"</userinput> můžete místo vektoru zadat také <userinput>"fit"</userinput> a rozsah x pak bude nastaven přesně a rozsah y bude nastaven s pětiprocentními okraji okolo čáry. Nakonec je možné zadat pomocí <userinput>"legend"</userinput> řetězec s legendou.</para>
5501
5761
<para>Příklady: <screen><prompt>genius></prompt> <userinput>LinePlotDrawLine(0,0,1,1,"color","blue","thickness",3)</userinput>
5502
5762
<prompt>genius></prompt> <userinput>LinePlotDrawLine([0,0;1,-1;-1,-1])</userinput>
5564
5824
<synopsis>SurfacePlot (fce)</synopsis>
5565
5825
<synopsis>SurfacePlot (fce,x1,x2,y1,y2,z1,z2)</synopsis>
5826
<synopsis>SurfacePlot (func,[x1,x2,y1,y2,z1,z2])</synopsis>
5566
5827
<para>Vykreslit funkci plochy, která přebírá buď dva argumenty nebo komplexní číslo. Jako první se předává funkce, pak následují omezení <varname>x1</varname>, <varname>x2</varname>, <varname>y1</varname>, <varname>y2</varname>, <varname>z1</varname>, <varname>z2</varname>. Pokud žádná omezení nejsou zadána, použijí se aktuálně nastavená omezení (viz <link linkend="gel-function-LinePlotWindow"><function>SurfacePlotWindow</function></link>). V současnosti umí Genius vykreslovat jen funkci jedné plochy.</para>
5567
5828
<para>Příklady: <screen><prompt>genius></prompt> <userinput>SurfacePlot(|sin|,-1,1,-1,1,0,1.5)</userinput>
5568
5829
<prompt>genius></prompt> <userinput>SurfacePlot(`(x,y)=x^2+y,-1,1,-1,1,-2,2)</userinput>
5572
5833
</varlistentry>
5835
<varlistentry id="gel-function-SurfacePlotData">
5836
<term>SurfacePlotData</term>
5838
<synopsis>SurfacePlotData (data)</synopsis>
5839
<synopsis>SurfacePlotData (data,label)</synopsis>
5840
<synopsis>SurfacePlotData (data,x1,x2,y1,y2,z1,z2)</synopsis>
5841
<synopsis>SurfacePlotData (data,label,x1,x2,y1,y2,z1,z2)</synopsis>
5842
<synopsis>SurfacePlotData (data,[x1,x2,y1,y2,z1,z2])</synopsis>
5843
<synopsis>SurfacePlotData (data,label,[x1,x2,y1,y2,z1,z2])</synopsis>
5845
Plot a surface from data. The data is an n by 3 matrix whose
5846
rows are the x, y and z coordinates. The data can also be
5847
simply a vector whose length is a multiple of 3 and so
5848
contains the tripples of x, y, z. The data should contain at
5852
Optionally we can give the label and also optionally the
5853
limits. If limits are not given, they are computed from
5854
the data, <link linkend="gel-function-SurfacePlotWindow"><function>SurfacePlotWindow</function></link>
5855
is not used, if you want to use it, pass it in explicitly.
5856
If label is not given then empty label is used.
5860
<screen><prompt>genius></prompt> <userinput>SurfacePlotData([0,0,0;1,0,1;0,1,1;1,1,3])</userinput>
5861
<prompt>genius></prompt> <userinput>SurfacePlotData(data,"My data")</userinput>
5862
<prompt>genius></prompt> <userinput>SurfacePlotData(data,-1,1,-1,1,0,10)</userinput>
5863
<prompt>genius></prompt> <userinput>SurfacePlotData(data,SurfacePlotWindow)</userinput>
5867
Here's an example of how to plot in polar coordinates,
5868
in particular how to plot the function
5869
<userinput>-r^2 * theta</userinput>:
5870
<screen><prompt>genius></prompt> <userinput>d:=null; for r=0 to 1 by 0.1 do for theta=0 to 2*pi by pi/5 do d=[d;[r*cos(theta),r*sin(theta),-r^2*theta]];</userinput>
5871
<prompt>genius></prompt> <userinput>SurfacePlotData(d)</userinput>
5877
<varlistentry id="gel-function-SurfacePlotDataGrid">
5878
<term>SurfacePlotDataGrid</term>
5880
<synopsis>SurfacePlotDataGrid (data,[x1,x2,y1,y2])</synopsis>
5881
<synopsis>SurfacePlotDataGrid (data,[x1,x2,y1,y2,z1,z2])</synopsis>
5882
<synopsis>SurfacePlotDataGrid (data,[x1,x2,y1,y2],label)</synopsis>
5883
<synopsis>SurfacePlotDataGrid (data,[x1,x2,y1,y2,z1,z2],label)</synopsis>
5885
Plot a surface from regular rectangular data.
5886
The data is given in a n by m matrix where the rows are the
5887
x coordinate and the columns are the y coordinate.
5888
The x coordinate is divided into equal n-1 subintervals
5889
and y coordinate is divided into equal m-1 subintervals.
5890
The limits <varname>x1</varname> and <varname>x2</varname>
5891
give the interval on the x-axis that we use, and
5892
the limits <varname>y1</varname> and <varname>y2</varname>
5893
give the interval on the y-axis that we use.
5894
If the limits <varname>z1</varname> and <varname>z2</varname>
5895
are not given they are computed from the data (to be
5896
the extreme values from the data).
5899
Optionally we can give the label, if label is not given then
5900
empty label is used.
5904
<screen><prompt>genius></prompt> <userinput>SurfacePlotDataGrid([1,2;3,4],[0,1,0,1])</userinput>
5905
<prompt>genius></prompt> <userinput>SurfacePlotDataGrid(data,[-1,1,-1,1],"My data")</userinput>
5906
<prompt>genius></prompt> <userinput>d:=null; for i=1 to 20 do for j=1 to 10 d@(i,j) = (0.1*i-1)^2-(0.1*j)^2;</userinput>
5907
<prompt>genius></prompt> <userinput>SurfacePlotDataGrid(d,[-1,1,0,1],"half a saddle")</userinput>
5574
5913
<varlistentry id="gel-function-VectorfieldClearSolutions">
5575
5914
<term>VectorfieldClearSolutions</term>