Each session is a numbered collection of levels, each level has a type: commandline, comment, expression editor, spreadsheet, program, 2-d or 3-d geometry, or logo-like turtle.
If no commandline is available, you can get a new one by the
menu. You may modify existing commandlines or write in a new
commandline. The following shortcuts are available
When you evaluate a commandline, a log output may be displayed (written in blue over white by default), followed by the answer, which might be an equation or a graphic (2-d or 3-d) widget if the answer is a graphic object (for lists, the widget type corresponds to the type of the last evaluated object).
If you do not want to see the answer displayed (for example if
you store a large matrix in a variable), just finish
your commandline by
Comments are inserted using the
CAS->New comment menu.
They are by default written in green instead of red over white.
Comments are not evaluated when pressing Enter (the effect is to
put the cursor to the next level).
Typing the shortcut Alt-e or using the menu Expression->New expression will open an expression editor above the current level. The scientific keyboard should automatically appear (press the x button at the top right of the keyboard if you don’t want it).
The expression editor lets you enter complex mathematical expression in 2-d like on a paper. For example suppose we want to enter
Open an expression editor (Alt-e) then type
/(for the division)
You can now move the selection in the tree of the expression with the arrows keys :
Another example, let’s enter
Type Alt-e to open a new expression editor
,key will switch to a defined integral (to do the reverse operation, one would select each bound and press the backspace key)
We know list the other special keys in the expression editor:
": Outside edition mode (no visible cursor), edit the selection like in a commandline, this is especially useful if you want to edit a function name. In edition mode, switch from considering the edit as a string or as a normal edit.
,: if a sequence is selected, add a 0 to the end of the sequence and select it. If the selection is not a sequence, creates a sequence of size 2 with first element the selection, init the second element to 0 and select it. You can move the newly created 0 in the sequence with Ctrl-→ and Ctrl-←.
(: if a sequence is selected, make a user function applied to this sequence, the name of the user function is initialized to
fand selected (type the function name to replace the
fby your function name). If a vector is selected, it is replaced by a sequence.
[: if a sequence is selected, it is replaced by a vector, if a vector is selected, an indexed vector/matrix position is created where the variable name of the vector/matrix is initialized to
mand selected (type the matrix/list name to replace
Msgoutput, click on the
Msgbutton to make it visible or not)
Programs may be written in a commandline if they are one or two
lines long, but for more complex programs, it is a good idea to
put them in a separate program level, using the
Prg->New program menu. This will open an editor in
a new level. Type your program (the Prg menu may help you
for the syntax of tests, loops, function definition, etc.),
and press the OK button once completed.
If parse is successfull, you can test your program
in any commandline.
Prg menu has items to open or
import an existing (program) file inside the current text, save
or export the current program (independently from the worksheet).
You can also use the menu
to insert programming structures. There are buttons to find the
next occurence of a search string, to parse the current program
(errors are displayed in the messages area) and to save the
program (the current filename is displayed at the right of the
The keywords of the language are highlighted. In Xcas programming mode, the tabulation key may be used for indentation (experimental feature).
Tip: before pressing the OK button, check the programming syntax by looking at the status area button in the middle at the top of the session. If you need to change the syntax, hit the status button and select the right syntax.
A graphic output is made of a 2-d or 3-d scene with controls, it corresponds to a unique commandline above it. You can create some examples easily using the Graph menu.
A geometry figure is the display of a 2-d or 3-d graphic scene representing the graphical objects of the commandlines that are on it’s left:
The controls are common to 2-d, 3-d graphics or geometry. You can move left, right, up and down the window, redefine it using coordinates, zoom in and out, pause and restart an animation using the buttons and the M menu at the right of the graphic, or using the Graph menu. In 2-d, the coordinates of the mouse are displayed while it is in the graphic area. You can modify the visualization window with the mouse (drag will move, use the scroll button for centered zoom in/out, or select an area with the right mouse button for an area zoom in). In 3-d, you can rotate the representation along the current x, y, z axis with a mouse drag outside of the scene rendering, or by hitting the x,X, y,Y and z,Z key (if the focus is in the 3-d scene).
Note that the controls apply only to the visualization, not to the creation
of graphic objects. For example, if you create a plot of a function,
the discretisation parameters for this plot (e.g. minimal value for
x) are fixed and will not change if you move the minimal visualisation
value using the controls. You must recreate a graphical object if
you did not choose correctly the parameters. For example if you
run the command
plot(sin(x)), the minimal value for computation
of x will be the default value
(Xmin from the Geo configuration, -10 by default). If
you move the minimal value of x for visualization below Xmin, you will
not see the plot there. To see the plot below Xmin, you would have
to specify something like
plot(sin(x),x=-20..0) and validate
the commandline. This limitation does not apply to geometric objetcs
(point, segments, lines and circles)
which will always be drawn if they are visible.
A M menu is available below the controls (it’s items are also available
from the top Geo menu),
it contains items to print
and control the screen. You can export a graph to encapsulated
postscript and to PNG (you must have the converting tools
netpbm or ImageMagic
installed, this should be installed by the Xcas installer under Windows. If they
are not installed under Linux, run your software installer or
open a Terminal
sudo apt-get install imagemagick
for Debian/Ubuntu distributions or
sudo yum install imagemagick
for Fedora-compatible distributions).
Title and axis legends must be part of the command(s) that generate the graph or geometry window. For example, try this on a commandline
f(t):=sin(t);title="Graph of f on a period",
Geo->New figure->geo2d menu to make a new 2-d geometry
session. This will open a new level with a “subsession” (group of
commandlines) at the left,
a 2-d screen in the middle, and the controls at the right. If there
are parameters, they will be below the controls at the right.
The subsession is a list of commandline levels. Evaluation of
a commandline level will automatically reevaluate all levels
below (i.e. with a higher level number), therefore if you use
one level to define an object and modify the definition of this
object later, all objects depending on this object will be modified.
Modification of a level defining a point or a 1-d parameter can be
done interactively with the mouse either in the geometric screen or in the
parameter area (below the controls).
The geometry level has a mode, which affects how the mouse behave.
To erase a geometrical object, right-click on it, select Delete
or select it’s level in the
subsession at the left, and use the
menu or Backspace key.
For example, you can click three points with the mouse (in point mode),
this will create 3 levels with definitions for points A,B,C.
Then you can make the circle containing A, B, C either by selecting
Circles->circumcircle mode and click on A,B,C
or by entering in a commandline the
circumcircle command (menu
Remark: how to work with several figures in a tab
When you create objets in a figure with a mouse, the name of the created object is automatically choosen. This name is shared between figures of the same tab so that they don’t interfer if you have several figures in the same tab. If you want to copy a part of a figure in another figure, enter in a level of the target figure the instruction eval([ ],1) where you put inside the brackets the names of the objects to be copied (e.g. eval([A,B,AB],1) will copy A, B and AB from a previous figure to the new figure). If you change the initial figure (where A, etc. were defined), you must reeval the instruction in the target figure to reflect the changes (press Enter in the first level of the target figure).
Parameters or cursors are real values which can move in a fixed interval, e.g. between -5 and +5. The real value may be changed by moving a cursor with the mouse below the controls at the right of the geometrical representation. There are two kinds of parameters: formal and numeric parameters. Formal parameters have a formal name which is used in all exact calculations, and a numeric value which is used for all numeric evaluations (including graphical representation of objects depending on the parameter). They can therefore be used to make an analytical proof of a geometrical theorem using the CAS engine, while displaying a figure. Numerical parameters evaluate always to their numerical value, they can not be used to make an analytical proof (only to make conjectures like with most interactive geometry softwares).
To add a new parameter, use the Geo->Edit->Add parameter menu.
For example, add a level with
then define 3 parameters named a, b, c and add the command
plot(f(x)), then move one of them to see the
influence of each parameter
on the shape of the parabola.
You could also add a level
M:=point(mini,f(mini)) to display the minimum.
Note that the coordinates of M are displayed in terms of a and b
under the commandline defining M at the left. You would have to add a level with
evalf(coordonnees(M)) to see the current numerical value.
There are several options for 3-d graphs rendering that may be configured by hitting the cfg button. First, you have to choose between intrinsic colors or a scene viewed with 1 to 8 light spots, see below.
Then you can choose the x, y, z ranged that will be visible. The position of the eye visualizing the scene may be changed by specifying a plan equation (normal to the vision direction). You may also easily change the view point outside of the cfg configuration window either with the mouse (push outside of the parallelepipedium, drag the mouse and release it at your option) or with the x,X, y,Y, z,Z keys to rotate around the x, y or z axis.
By hitting the r key or by selecting
you can get a visualization animation by rotation around the
origin. By default, it will rotate the viewpoint around the z axis
but this is configurable from the
cfg button, you can configure
Anim: what will be animated, viewpoint if bit8 is 1, spot number 7 to 0 if bit 7 to 0 are set to 1. For example, 255 will move all spots leaving the viewpoint unchanged.
t: interval between 2 redrawing
n: number of steps for a round trip
z: coordinates of the axis
d: normally 0, may be non 0 if you want also to move the number of image of a programmed animation
You can specify the axis of rotation in the commandline defining the scene by
are the coordinates of the axis of rotation.
Do not confuse visualization animation with programmed animation
obtained by instructions like
animate, animate3d, animation.
If you enable
Lights in the
cfg configuration of a 3-d
graph, the scene will be rendered by the OpenGL lighting
algorithm. You can enable 1 to 8 spots of light, each is configurable
Each spot has geometric properties: it may be a positional spot if w=1 or a directional spot if w=0
x->, y->, z->. Light coming from a positional spot may be attenuated, the attenuation may depend on the distance between the spot and the object (with a quadratic formula,
att0, att1, att2in the spot configuration), and by the cosine of the angle between the spot direction and the segment spot-object to an exponent (
expin the spot configuration). In addition, the spot may light only inside a cone of angle configurable by the
cutoffvalue (in degrees, use 180 for no cutoff or a value between 0 and 90). An additional attenuation comes from the cosine of the angle incoming direction-normal to the object, so that zenithal lighting is maximal.
Objects from the scene may have their own properties with respect to three kinds of light:
In addition, an object may have intrinsic light, called emission.
Each property must be specified for 4 channels: r (red), b (blue)
and g (green) for the colors, and a (alpha) for transparency (if
Object properties must be specified in their definition (on
gl_ambientfor diffuse, specular or intrinsic light. Default is 0.2 for ambient, 0.8 for diffuse and 0 for emission on r,g,b channels and 1 on alpha channels.
gl_texture="filename"specify an image filename that will be mapped on a sphere or a polygon or a parametric defined surface.
Summing up, the formula for light on each channel is :
3-d geometry is based on the same principle than 2-d geometry: a subsession at the left and the representation in the middle. Mouse interaction outside the representation will change the viewpoint, inside the representation it will depending on the mode: draw a point, a segment, ... according to the mouse plan displayed above (all mouse clicks are supposed to refer to this plan, which is perpendicular to the visualisation axis).
Table->new spreadsheet menu to add a spreadsheet level.
You will see a small configuration screen where you can change
the number of rows/columns, if an attached graph is displayed,
and also a variable name that you can use to get values
from commandlines outside of the spreadsheet (using the matrix notation,
e.g. a[1,2] will return the value of the cell at row 2, column 3
in xcas syntax mode, or at row 1, column 2 in other syntax modes).
You can modify the spreadsheet configuration by hitting the
status line above the cells or with the
File->variable name menu later).
If you have choosed to display the graph inside the spreadsheet
configuration, it will dynamically
display all cells that evaluate to a graphic object.
You may also display all the graphic
objects of the spreadsheet in a separate window, either in 2-d or in 3-d by
hitting the 2d or 3d button at the right of
the spreadsheet menu.
A cell may contain
a fixed value (any valid Xcas object: integer, real, symbols,
algebraic objects, strings, ...) or a formula depending on other
cells. The syntax for formulas is the same as for many spreadsheet,
begin with a
=, then enter an algebraic expression where
other cells are represented using a symbol made of the column
name (e.g. A) and the row number (e.g. 1). When copying cells,
cell dependance in a formula is considered relative
unless you write a dollar ($) sign before the column name or
row number. You can enter an area instead of a cell name, an area
is always a rectangular area, it is made of two cell names separated
.. representing opposite vertices of the rectangular area.
To enter a new value or formula in a cell, click on the cell, then enter your value or formula with the keyboard. As soon as you type a normal character, the focus will move from the sheet to the commandline above the sheet. To help enter formula, you can use the mouse to select a cell or a cell area. Once the value or formula is correct press the enter key to validate it. You can cancel your edit at any time by pressing the Esc key.
To modify a cell value, click on the cell so that the value or formula is displayed in the commandline above, then click in the commandline, modify it and press Enter (or Esc to cancel).
You can move in the sheet using the mouse or the direction keys, or
using the “goto” input value at the topleft of the sheet. Just enter
a cell name then enter to move there. If the cell does not exist,
the sheet will be enlarged to make it exist. You can also enter
an area in the “goto” input value to select this area without the
mouse. You must use the “goto” input value to make special
selections that are not connected areas, for example
“select” the tabular with rows 1 to 3 and columns A, B, D and F.
You can copy and paste a rectangular area with the mouse like this:
select the rectangular area with the mouse, click on the target cell,
click on the commandline, type Ctrl-U to erase the previous
value then click on the middle button and type enter.
If you want to copy a cell formula to an area of the spreadsheet,
push at the right bottom part of the cell (when the mouse is on the
correct area of the cell, it will display a different cursor)
and move the mouse over the area you want to
copy, then release the mouse.
You can also copy cells using a menu item in the spreadsheet
Edit menu, you can either copy to the left, or to the bottom,
or to a rectangular area previously selected with the mouse (in this
case the cell which was below the mouse when you pushed the button
will be copied to the rectangular area).
The spreadsheet can be saved, exported, imported, etc. using the
File menu. The spreadsheet is also saved
as part of the session (but not as a standalone spreadsheet)
when you save the whole session. When you load a session, the
spreadsheet will not be evaled automatically, you must reeval
it with the
reeval button explicitely (or modify one cell).
Xcas does not provide filters for native binary spreadsheet formats,
but you can import spreadsheet from other softwares or data using
copy/paste or by saving them in the text CSV (comma separated values) format:
cells values must always be separated by the same character e.g. a comma, and
another character should be used to start a new row like a newline.
For example, you can select a spreadsheet area inside Open Office
and paste it inside Xcas.
If you want to import formulas instead of values,
use the Tools->Option menu of Open Office, find the spreadsheet Display item
and check Formulas. Select the area inside Open Office, then
paste at the same upper left cell position inside Xcas.
Alternatively you can save the spreadsheet in CSV format inside
Open Office with the
menuitem, then select CSV in the choosebox below.
Then inside Xcas, use the
File->Insert CSV menu item,
select the file, change the separators if Xcas made a bad guess.
Note that Xcas must use row numerotation starting
at 1 instead of 0 for Open Office CSV formula import (this is the default).
Click on the status line or select inside the
for configuration and sheet modifications operations. Configuration
operations should be self-explanatory, except for matrix fill cells :
when entering a matrix in the commandline,
you can choose between two modes, either the matrix will fill
a rectangular area of cells, or it will fill only one cell.
menu is useful to make statistic plots in the corresponding graph.
When you make a graph using this menu, you will have to select
the data area where the statistic function will be applied (e.g.
a polygonplot on
A1..B10) and a target cell. The target
cell is a regular cell which was empty and will contain the formula
defining the graphic object that will be displayed. If you check the
value box, the graph will not change later, but if you don’t check
the value box and modify
one data cell later, the graph will be updated like any cell
depending on this data cell would be.
To add a turtle session, use the
Turtle-> new turtle menu.
A logo level is made of three parts, the graphic display
in the middle, a subsession of commandlines at the left
and an editor at the right. Commandlines are executed as in
a main session (commandlines below an evaluated command
are not reevaluated unlike in a geometry session). The editor
records all commands.
In a logo level, you can pilot a turtle, giving it orders like forward
10 steps, turn left or right, etc. It will display a trace
using a pen with a defined color.
You can use any language construction of Xcas to program the
turtle moves. The current language use French commandnames
(e.g. avance=move forward, etc.), the most important commandnames
are available by clicking on the buttonbar below the turtle screen
(check that the cursor is on a commandline before clicking on
the button corresponding to the command you want to enter).
Most commands have a default argument (e.g. 10 for avance),
if you want to add parameters, do not add parenthesis. Logo
commands use the same syntax as the
if you want to specify priorities, put parenthesis around
the command and arguments, like this