Operation | Key | Usage | Example |
---|---|---|---|
Square Root | expression | Use brackets for calculations under a root To use the square root operation first press the square root button and then insert the argument |
|
Cubic root | + | +expression | |
Other Roots | expressionexpression |
To use this operation, first type the degree of the root and then type the argument. |
|
Random Number Generator | random number key |
(Number between 0 and 10) The number after the "rnd" is the maximum value of the random number. |
|
Differentiation | (function,x-value) |
The function parameter must be X. Example: 2X^3-3X+3 The result is the is the gradient of the function at the given x-value. The program can only calculate an approximated value of the differentiation. The precision is about +/-1e-8 |
|
Integration: | (function, start value, end value) |
The function parameter must be X. Example: sin(X)*3 The area below the graph of "function" between "start value" and "end value" is calculated. An integral calculation will fail if there is a vertical asymptote between start and end point. The precision is about +/-1e-9. |
|
Usage of Variables | + any letter. | You can use 26 variables to store values. To use the variables by the integrated buttons, press | |
Store/Recall Values |   |   | store a value use stored value A stored value can be used like any other number. Unused variables are set to 0. |
Unary operators with operand right |
- sin, cos, tan asin, acos, atan sinh, cosh, tanh asinh ,acosh, atanh log, ln, exp sqrt, curt real, imag, abs, arg, conj ! (not) ~ (int), (float), (bool), (string) |
Unary operators with operand left | ! (Faculty) |
Binary operators |
; && || -> = == != >= <= > < + - * / % << >> x & | ^ root sprod |
Script commands |
if else while for print() clear setcursor(,) sleep() rnd() run() d/dx(,) integ(,,) getline getkey keystate break continue stop |
brackets |
( ) {} |
values |
345 786.899 -76e-8 786i "lkasdjl" |
variables |
A A[] A[][] |
In base mode, the letters A - F are reserved for hexadecimal numbers, so they can't be used as variables.
But you can use the variables from G to Z to store results in base mode.
This mode is mainly used for logic functions and transformations between the different numeral systems.
If you want to input a number of a numeral system different to the default one, which you can choose with the
quick preferences box, you have to write a special prefix before the number:
Examples:
Hexadecimal | hex0FA46B The letters in hexadecimal numbers must be uppercase. |
Decimal | dec4575 |
Octal | oct01243 |
Binary | bin1000101111010 |
Logic functions |
These functions return only true or false as a result.
0 is false and everything different from 0 is true. && (and), || (or), ! (not) |
Binary functions |
These functions modify every single bit of a number. & (and), | (or), ~ (not), << (left shift), >> (right shift), xor |
Graph type | Function | Description |
---|---|---|
normal | sinX | Sine wave Coordinate system: standard, trigonometric standard size |
(X+5)^2-4 | Parabola Coordinate system: standard, standard size | |
if(A<=10) (1-A/5)*x^2; else if(A<=20) -(x+5*(A-10)/10)^2; else -(x+5)^2-4*(A-20)/10; | Animated parabola Coordinate system: standard, standard size dynamic enabled with A from 0 to 30 logic enabled | |
polar | X+2 | Archimedian spiral Coordinate system: polar, standard size |
5*sin(4X) | Polar rose Coordinate system: polar, standard | |
2/(1+0.7cosX) | Ellipse Coordinate system: standard | |
parameter | T | Parabola Coordinate system: standard, standard size T from -10 to 10 |
T^2 | ||
sinT*(exp(cosT)-2*cos(4T)-(sin(T/12))^5) | Butterfly curve Coordinate system: polar, max. radius=5 T from 0 to 20 | |
cosT*(exp(cosT)-2*cos(4T)-(sin(T/12))^5) | ||
F=.01*T^3+1;U=1-A/15;((1+U)*T+(1-U)*F)/2 | Inverse function Coordinate system: standard, standard size, T from -10 to 10 dynamic enabled with A from 0 to 30 logic enabled | |
((1-U)*T+(1+U)*F)/2 | ||
(1-A/15)*T | Reflection Coordinate system: standard, standard size, T from -10 to 10 dynamic enabled with A from 0 to 30 logic enabled | |
T^3-5*T^2+5*T-2 | ||
F=.05*T^3;U=atan(F/T);R=sqrt(T^2+F^2);cos(pi/30*A+U)*R | Odd function Coordinate system: standard, standard size, T from 0 to 10 dynamic enabled with A from 0 to 30 logic enabled | |
sin(pi/30*A+U)*R | ||
3D | sin(X�)*cos(Z�) | Coordinate system: 3D, X, Y and Z from -3 to 3 |
L=0.01;U=2;K=1e-3;if(X<U)0;else{if(Z>0 && Z<X-U)K*Z*(X-U-Z/2)*(1+L*Z);else if (Z>0) K/2*(X-U)�*(1+L*Z); else 0;} | MOSFET transistor current Coordinate system: 3D, X and Z from 0 to 10,Y from -0.01 to 0.04 logic expressions enabled | |
abs(arg(((X+Zi)^2-1)*((X+Zi)^2-2-i)^2/((X+Zi)^2+2+2i))) | Complex graph in 3D (X=Re,Z=Im) Coordinate system: 3D, X and Z from -2 to 2,Y from 0 to 5 logic expressions enabled, complex enabled (Calculator) | |
Complex graph | exp(Z*i) | Coordinate system: 3D, standard size |
Nyquist plot | 10/(1+Z*i) | Coordinate system: standard, standard size |
standard | polar | parameter | inequality | 3D-graph | Nyquist plot | |
Calculate Y-value | x | x | x | x | x | x |
Calculate roots | x | x | x | x | x | |
Newton's Method | x | x | x | |||
Calculate X-values | x | x | x | x | x | x |
Points of Intersection | x | x | x | |||
Maximum and minimum values | x | x | x | |||
Calculate Integral | x | x | x | x | ||
Calculate Differential | x | x | x | x | x | |
Calculate Z-value | x |
Function | Procedure |
---|---|
Calculate y-value | Insert a x-value into the input line or click into the graphics output window where you want to calculate the y-value. Then press the calculate button. The y-value of all displayed graphs will be shown in a table. Parameter graphs may have more than one y-value with the same x-value. For 3D-Graphs you have to insert x-value and z-value to calculate the y-value |
Calculate Roots | Choose a function from the function box and press the calculate button to calculate the roots of a function. |
Newton's Method | This is a special method of calculating roots. You can set a start value for the calculation and the number of steps to calculate. All results will be shown in the table. The first item in the last line is your result. |
Calculate x-values | Choose a function from the box and type the y-value you want into the input line. When you press the calculate button, the x-values are shown in the output table. For 3D-graphs, the y-value is also needed for calculation. |
Points of intersection | Choose two graphs from the boxes and press the calculate button. Then the points of intersection of the two graphs are shown. Don't choose two times the same function. |
Maximum and Minimum values | Choose a graph and press the calculate button and then all extreme values will be calculated. |
Integral Calculation | Just set a start point and an end point, then you can integrate the cosine function. The size of the area between the graph and the x-Axis is calculated. In 3D-Mode, you have to set X-Start, X-End, Z-Start and Z-End points for integration. The volume between the X-Z-Plane and the graph is calculated. |
Differential Calculation | For a differential calculation, you must choose a function and the point to calculate, then press the calculate button. It is also possible to calculate the Cartesian differentiation of a parameter function. For 3D-Functions, you have to set a X- and a Z-Value. All partial differentials at the given point were calculated. |
Calculate z-values | Choose a function from the box and type the x-value and the y-value into the input fields. Pressing the calculate-button will show you the results. |
Text drawing: If you press the text button, you will see an input dialog where you can set the text to draw. When you hold down the left mouse button, you can also see a preview. If you press the mouse button again, the text will be inserted again. To change the text, text size or color, you have to press the Text-button again.
Rubber: If you want to erase a part of the drawn things, you can use this tool. It makes the erased areas transparent. In preview mode, it is shown white.
Furthermore, you have an undo button and a button to clear the complete draw area.
3.3 Tables
In Extcalc, it is also possible to generate tables from functions.
The table window of Extcalc.
For the generation of this value tables, the same functions as for graphs will be used. You can generate tables
from every types of functions.
The tables are generated from the functions, which are activated in the function table. You can calculate
only tables from the type of functions, which is chosen at the type box. You can choose the table function type directly
with the box in the table window or by the table menu or by the table preferences dialog.
In the table preferences dialog, you can set the start and the end value for your table and you can choose the
number of values to calculate.
It is also possible to change the input values by clicking into the header of the table that shows the results.
You can insert the new input value into the shown dialog window.
For functions with the variable x or the complex z, on column per function is generated with the function values. For parameter
functions with the variable T, the same options as for the variable x are used. For every functions of this type,
one column with x-values and one column with y-values will be generated. If you generate a table with 3D-functions,
for every z-value of every function, one column will be generated.
3.4 Script Programming
Extcalc contains a script interpreter for running small scripts. You can edit and run this scripts directly with Extcalc.
3.4.1 Introduction
The syntax for Extcalc scripts is similar to C-language syntax, but the normal calculator commands and operations can also be used in
this scripts.
You can't use all script commands in the normal calculator. Loops and the command to run another script can only be used in script,
not in the calculator.
The scripts programs run in a separate console, and you may use the other extcalc functions while running a script.
Scripts can be managed, edited and started from the integrated script editor.
In this version 0.9.3 are not all planned features included.
3.4.2 The Script-Editor
The integrated script editor includes all needed editor functions and you can use it to write, modify and run your scripts.
Before you can use this editor, you have to create the script directories. Normally, this is done at the first start of extcalc, but if you
haven't done it there, you may need use the script preferences dialog from the preferences menu to create them.
There you have to create a script root directory and set the names for a code subdirectory and a data subdirectory.
This new script code directory will contain some example scripts. Other example scripts can be found at the Extcalc homepage
extcalc-linux.sourceforge.net.
Operation | Description |
---|---|
vector+constant, constant+vector, vector-constant, constant-vector | Add a constant value to every element of the vector |
vector+vector, vector-vector | Vector sum. Elements with the same index were added |
dotproduct: vector�vector | Multiply two vectors with a scalar as result |
crossproduct: vector*vector | Multiply two vectors with a vector as result. Both vectors must have three elements. |
vector*constant, constant*vector | Every element of the vector is multiplied with the constant. |
Operation | Description |
---|---|
matrix+constant, constant+matrix, matrix-constant, constant-matrix | Add a constant value to every element of the matrix |
matrix+matrix, matrix-matrix | Matrix sum. Elements with the same indices were added |
matrixproduct: matrix*matrix | Multiply two matrices. The result is also a matrix. |
vector*matrix | Multiply a vector with a matrix. The result is a matrix. |
matrix*vector | Multiply a matrix with a vector. The result is a vector. |
matrix*constant, constant*matrix | Every element of the matrix is multiplied with the constant. |
matrix^-1 | Calculate inverse matrix |
det matrix | Calculate determinant of a matrix. |
if( condition ) command for condition true; else command for condition false;If you want to run more commands, they must be written in braces (without semicolon at the end).
if(A==5) A=7; else { A=A+1; if(A>10) A=0; }
while( condition ) command that is ran while condition true;If you want to run more commands, they must be written in braces (without semicolon at the end).
F=0; while(F==0) { F=keystate; sleep(10000); }
for(initialization; condition; count-command) command that is ran while condition true;If you want to run more commands, they must be written in braces (without semicolon at the end).
for(A=-4;A<0;A+1->A) print(A); for(;;) print("this runs always");
print( Output );Output can be a variable, a command or a constant (like text).
A=12; print(A+3); //Output: 15 print("Hello World!\n"); // Text with newline at the end print(3>5); //prints out false
getline;This command does only make sense, if you use the return value.
X=getline; print(X); //or: print(getline);
getkey;This command does only make sense, if you use the return value.
F=0; while(F!=97) //loop runs, until you press a { F=getkey; F=(int)F; }
keystate;This command does only make sense, if you use the return value.
F=0; while(F!=97) //Loop runs, until you press a { F= keystate; F=(int)F; sleep(10000); //break if(F==0) print("Press a to stop\n"); //This text is always printed }
sleep( Time in microseconds );The script is stopped for the given time.
readfile( filename );Reads the file with the name filename and returns its content as string.
writefile(filename , content);Writes the content ans string into a file named filename.
appendfile(filename , content);The same as writefile, but if a file still exists, the content will be appended.
removefile("count.txt"); //remove file, if it exists for(C=0; C<100; C++) //loop from 0 to 99 { apendfile("count.txt",C); //write numbers from 0 to 99 into a file appendfile("count.txt","\n"); //seperated by a newline }
removefile(filename);This command removes the file filename from the script data directory.
glshow;This command updates the GL window.
glclear;This command clears the GL window.
glbegin( type );This commands must be called to start drawing. It must also be called to draw into a dislplay list.
glend;This command must be called after glbegin(), when drawing is done.
glbeginlist;This command starts a display list. After this command, all gl commands expect text drawing were stored in the display list.
glendlist;This command ends the display list and returns the list ID.
glcalllist;With this command, you can call a display list, so that it is drawn.
glbeginlist; //start list glbegin(lines) //start drawing lines glpoint(-5,-5,-5); //set coordinates glpoint(5,5,5); glend; //end drawing lines glbegin(triangles); //start drawing triangles glpoint(-5,-5,0); //set coordinates glpoint(5,-5,0); glpoint(0,5,0); glend; //end drawing triangles L=glendlist; //end list, store ID glclear; glmove(0,0,1); //set transformation matrix glcalllist(L); //call list glmove(0,0,-2); //change transformation matrix settings glcalllist(L); //call list again glshow; //show scene
glpoint(x,y,z);This command must be called to set object coodinates after calling glbegin().
glcolor(r,g,b);With this command, you can set the draw color.
glmove(x,y,z);This command moves a GL object.
glrotate(angle,x,y,z);GL objects can be rotated by this command. The rotation is described by the angle in degrees (angle) and by a vector (x,y,z), which represents the rotation axes. All parameters are of type float.
glscale(x,y,z);With this command, a GL object can be scaled. All parameters are of type float.
#config gl //gl initialisation #config axesoff #config rasteroff #config labelsoff glstartlist; //generate gl list for a cube glbegin(quads); glpoint(-1,-1,-1); glpoint(1,-1,-1); glpoint(1,1,-1); glpoint(-1,1,-1); glpoint(-1,-1,1); glpoint(1,-1,1); glpoint(1,1,1); glpoint(-1,1,1); glpoint(-1,-1,-1); glpoint(-1,-1,1); glpoint(-1,1,1); glpoint(-1,1,-1); glpoint(1,-1,-1); glpoint(1,-1,1); glpoint(1,1,1); glpoint(1,1,-1); glpoint(-1,-1,-1); glpoint(-1,-1,1); glpoint(1,-1,1); glpoint(1,-1,-1); glpoint(-1,1,-1); glpoint(-1,1,1); glpoint(1,1,1); glpoint(1,1,-1); glend; L=glendlist; //end list and store list R=0; //rotation angle while(1) { R=R+1; glclear; //draw scene //int this order, the cube rotates around its y-axes, has a size of 4x4x4, and //its rotatione axes is located at 12,0,0 glscale(4,4,4); //resize glmove(3,0,0); //move glrotate(R,0,1,0); //rotate glcolor(30,30,200); glcalllist(L); glloadidentity; //int this order, the cube rotates around the coordinate systems y-axes, has a size of 3x3x3, and //rotatis with radius of 9 glscale(3,3,3); //resize glrotate(R,0,1,0); //rotate glmove(3,0,0); //move glcolor(200,30,20); glcalllist(L); glshow; sleep(30000); }
glloadidentity;This command resets all transformations.
glstring(x,y,text);This command shows a text at the 2D-position x,y. The start point is the upper left edge. The coordinates are in pixels. x and y are integer values. Text can be a string or a number (float or int).
drawpoint(x,y);This command draws a point of the currently set color into the 2D-graphics window of the script interpreter. The origin of the coordinate system is the upper left corner of the window and x and y are integer values.
drawline(xstart,ystart,xend,yend);This command draws a line of the currently set color from the given start point to the given end point. All coordinates are integer values.
drawrect(xstart,ystart,xend,yend);Draws a rectangle with the given coordinates. All coordinate values are of integer type.
drawcircle(xstart,ystart,xend,yend);Draws an ellipse into the rectangle defined by the given coordinates. The coordinates are integer values.
drawstring(x,y,text);This command shows a text at the position x,y. The coordinates are integer values. Text can be a string or a number (float or int).
drawcolor(r,g,b);Sets the draw color for all 2D-drawing commands. The color is set by red, green and blue component which can have values from 0 to 255.
drawclear;This command clears the 2D-graphics window of the script interpreter.
(target type)variable;target type must be one of (int) (float) (string) (bool).
A=12.3545; A=(int)A; // A is now 12 print((int)"abc"); //abc can not be converted to a number, so it is set to 97 (ASCII-Code of a) C="234.45"; D=(float)C; //text can be interpreted as number, so it is set to the value print(D+1); //prints 235.45
run("script path");With this command, you can execute another code file from your script.
run("subprogram"); //runs a subprogram with the name subprogram that is in the script code directory runt("prog/routine4"); //runs a subprogram with the name routine4 which is in the directory prog
Variable[index]; //1-dimesional array Variable[1. index][2. index]; //2-dimensional arrayEvery variable can also be an array, if you use the index-operator on it
A=" "; for(C=9; C>=0; C=C-1) //reads 10 characters A[C]=getkey; print(A); //prints the characters inverted
In script interpreter integrated operators (can be used with every variable type) + add - sub == compare != unequal > greater < less >= greater or equal <= less or equal && logic and || logic or ! logic not = set (like in C) -> set (like in Calculator) [] index operator [][] index operator matrix All other operators can be used like in the calculator.The operators can also be used together.
12.3545->A; (int)A->A; // A is now 12 print((int)"abc"); //abc can not be converted to a number, so it is set to 97 (ASCII-Code of a) "234.45"->C; (float)C->D; //Text can be converted do a number, so D is set to this value print(D+1); //prints 235.45
#config PREFERENCEHere is a list of possible preferences:
#config complexon //switch complex numbers on #config complexoff //switch complex numbers off #config angledeg //set angle type to degrees #config anglerad //set angle type to radian #config anglegra //set angle type to grade #config modebase //set base mode #config modescientific //set scientific mode (default) #config outputlengthXX //set length of floating point output; XX must be a number between 2 and the max. output length //the number is written directly behind outputlength without space #config clearmemory //always clear array memory before starting #config gl //switch to 3D-GL window //this MUST be set to use 3D-graphics #config graphics //switch to 2D-graphics window //this MUST be set to use 2D-graphics #config axeson //enable or disable 3D-coodinate system axis #config axesoff #config rasteron //enable or disable 3D-coodinate system raser #config rasteroff #config labelson //enable or disable 3D-coodinate system labels #config labelsoff
#define macro replacementMacros with arguments are not allowed.
//loop starts at 3 (so it can add 2 instead of 1 per step) print("2 "); for(3->A;;A+2->A) { 0->C; sqrtA->D; //prime number check with modulo for(2->B; C==0 && B<=D; B+1->B) { if((A%B)==0) 1->C; } if(C==0) { print(A); print("\t"); } }
//initialization //variables for ball movement 4->A; 1->B; 1->C; 1->D; //variable for player movement 10->E; //stop variable 0->S; //counter for ball movement //the ball moves only every fifth run 0->I; //variables to store old drawing coordinates //needed that it redraws only if needed //and that the screen can be cleared without //flickering 4->G; 4->H; 9->J; 0->X; clear; for(;S==0;I+1->I) { //move ball every fifth time E->J; if(I==5) { 0->I; A->G; B->H; A+C->A; B+D->B; if(A>50) -1->C; else if(A<1) 1->C; if(B<1) 1->D; else if(B>12) { if(A>E-3 && A<E+3) { -1->D; X+1->X; } else 1->S; } //long break for ball movement sleep(30000); } //read keystate and move player keystate->K; 1+K-1->K; if(K==100 && E<48) E+1->E; if(K==97 && E>2) E-1->E; //short break //needed that player can move fast sleep(5000); //print ball if needed if(A!=G || B!=H) { setcursor(G,H); print(" "); setcursor(A,B); print("*"); } //print payer if needed if(E!=J) { if(E>J) { setcursor(J-2,14); print(" "); setcursor(E-2,14); print("#####"); } else { setcursor(J+2,14); print(" "); setcursor(E-2,14); print("#####"); } } //print score setcursor(51,1); print(X); } //loop finished //because player didn't get the ball //print score sleep(300000); clear; print("\n\n\n***********End************\n"); print("********Points: **********"); setcursor(16,4); print(X); print("\n\n");
4x - 2y = 9 -2x + 5y = -2The matrix size would be 2 x 3
4 -2 9 -2 5 -2- choose a matrix of size n x n and a vector of size n
4 -2 -2 5The vector of size 2 would be:
9 -2You can set the number of unknowns with the unknowns box. The chosen matrix and vector will be resized by pressing the set button.
2.25 0.75If the linear system of equations could not be solved, because it has no valid results or infinitely mutch results, the last step of the gauss algorithm will be shown at the table.
Type | Description |
---|---|
Identity Matrix | Size n x n, the diagonal values are 1, the rest is set to 0. Identity of matrix multiplication. |
Zero Matrix | Size n x m, all values 0. |
Zero Vector | Vector Size n, all values 0. |
- X-, Y-, Z-rotation matrix | Size can be 2 x 2 or 3 x 3. Generates a rotation matrix with the given angle. |
Scaling Matrix | Size can be 2 x 2 or 3 x 3. Generates a scaling matrix with the given scale values. |
function | Description |
---|---|
const | Constant value. This calculates the mean of the given y-values. |
a*x+b | Straight line. The line is approximated by least square regression. |
a*x^2+b*x+c | Quadratic equation. The points data is approximated by a quadratic function using least square regression. |
a*e^(b*x) | e-function. Approximates the given points by a e-function using least square regression. |
a*b^x | Exponential function. Approximates the given points by a exponential function using least square regression. |
Suse Linux 11.2: | OK |
Debian Lenny: | OK |
Ubuntu 9.10 | OK |
Mandriva 2010: | OK |
Fedora Core 12: | OK |
FreeBSD 6.2: | read comment |