Please submit all suggestions and bugs via github.
Leibnitz provides the calculator you've always wanted, short of handwriting recognition. The major features that it provides are:
The Expression window provides a simple, yet powerful interface for entering and evaluating algebraic expressions. The top half of the window displays the expression, while the bottom half displays a history of the expressions that have been evaluated, called the tape.
At the right is the keypad that you can use to enter simple expressions. This works just like a hand held calculator. "Clear" clears the value that you are entering, while "Clear all" clears the entire expression. Once you have mastered the keyboard interface described below, you will probably want to hide the keypad by turning off the "Show keypad" option on the Preferences menu.
The Close button in the upper right corner closes the window and discards the expression and the contents of the tape. When you quit, all the existing windows are saved, so you can start right where you left off when you run the program again later.
Expression windows have their WM_CLASS
set to Leibnitz_Expression
. This can be used to filter these windows out of a window manager's taskbar.
The simplest way to explain the interface is that you just type as if you were entering a text expression. The expression will be built graphically as you type.
New expressions are initally empty. This is drawn as a single question mark (?), which represents an empty input field. When you click on the input field, it becomes active, and you are ready to start typing.
Input fields accept numbers and the named constants defined in the Constants window. When you type an operator, the input field is parsed and becomes part of the expression, and a new input field is created based on which operator you typed. The operators are as follows:
+ addition - subtraction * multiplication / division ^ exponentiation | parallel combination: x||y = x*y/(x+y)
You actually only need to type a unique prefix of a named constant because the editor will complete it for you automatically when parsing it.
While entering a number, typing "e" lets you enter the exponent.
Input fields also accept certain pre-defined constants:
pi = 3.141592654... e = 2.718281828... i = sqrt(-1) j = sqrt(-1) (for Electrical Engineers)
You can also enter the names of pre-defined functions. The function name is parsed when you type a left parenthesis "(". You can also use the "Apply function" submenu on the Math menu if you don't remember the name of the function that you need.
sqrt square root abs absolute value sign algebraic sign (+1, -1) round nearest integer truncate toss fractional part log logarithm to an arbitrary base log10 logarithm base 10 ln natural logarithm log2 logarithm base 2 sin sine cos cosine tan tangent arcsin inverse sine arccos inverse cosine arctan inverse tangent(x) (-π/2 to +π/2) arctan2 inverse tangent(y,x) (-π to +π) sinh hyperbolic sine cosh hyperbolic cosine tanh hyperbolic tangent arcsinh inverse hyperbolic sine arccosh inverse hyperbolic cosine arctanh inverse hyperbolic tangent re real part im imaginary part arg phase angle conjugate complex conjugate rotate rotate(complex number, angle to rotate in degrees) max maximum of its arguments min minimum of its arguments parallel parallel combination: x||y = x*y/(x+y)
The last three functions can take an arbitrary number of arguments. Typing a comma ( , ) adds another argument.
While entering an expression, the return key, the space bar, and the right parenthesis ")" all parse the current input field and then select it. The spacebar and the right parenthesis will extend the selection "upwards" when pressed again. This allows you to enter an expression like x^2+1
without using the mouse by typing x ^ 2 space space + 1
Selecting a piece of the expression lets you manipulate it using the Math menu. The "Apply function" submenu transfers the selection to the first argument of the function that you select from the menu.
The Backspace key replaces the selection with an input field. Typing Backspace again deletes the input field. Typing an operator applies it to the selection. Typing other text replaces the selection with an input field.
Double clicking on a number or a named constant lets you edit it.
There can be more than one empty input field in an expression. A question mark is used to represent each one. The Tab key moves you from one input field to another.
When you copy an expression to the clipboard, you can paste it into any other program to obtain a textual version of the expression. You can also copy an expression in this form from another program and paste it into any Expression window.
When you select "Plot 2D function..." from a menu, you will first get a dialog asking you to enter the function to plot. The independent variable is called x, so for example, to plot the sine function, you would enter sin(x).
The menu lets you specify whether to create a new graph or to add the curve to an existing graph. The existing graphs are listed by displaying their titles.
The curve name is the initial name that will be associated with the curve in the graph's legend. If you leave this empty, it will be set to the function itself.
The initial range is the range to use when first displaying the curve. Once the graph is created, you can zoom in or out.
You can change the scale of the graph in several ways. The "Change scale..." item on the Options menu opens a dialog for changing the axes ranges and switching between linear and logarithmic scales. Double-clicking on either axis also opens this dialog. Clicking and dragging inside the graph's frame zooms in to show the selected region. If you hold down the Meta key, a nice looking scale will be chosen around the area of interest. To return the scale to the initial setting, select "Reset scale" from the Options menu.
To change the other settings for a curve, either select "Change curve options..." from the Options menu or double-click on the appropriate curve label in the legend.
You can edit the graph's title and axis labels by either selecting "Change labels..." from the Options menu or double-clicking on the text.
The range specifies what portion of the curves will be drawn. This is useful if you need to use a particular scale, but only want to show the function over a part of the scale. "Copy scale to range" sets the range to the current scale, so when you zoom out, the portion of the curve that is drawn remains the same. "Change range..." opens a dialog so you can set the range directly. "Clear range" clears the range so the curves are always drawn to fill the window.
Cursors help you estimate the position of various features on a curve. To move a cursor, simply click on it and then either drag it around or use the arrow keys for finer adjustments. Holding down the Meta key while using the arrow keys makes the cursor move faster. If you turn on "Dual cursors," the values of both cursors will be displayed, along with the distance between them. "Mark cursor" saves the position of the selected cursor in the Cursor Mark Values window and also draws a gray line at the position so you can find it on the graph.
Plot windows have their WM_CLASS
set to Leibnitz_Plot
. This can be used to filter these windows out of a window manager's taskbar.
The Constants window lets you define named constants for use in expressions and plots. The names x and y are reserved as the independent variables when plotting 2D functions. The name t is reserved as the independent variable for the future, when parametric plots are implemented. pi, Pi, π, e, E, i, I
, and j are also reserved to represent the standard mathematical constants 3.14..., 2.718..., and sqrt(-1).
To include a Greek character in a name, either use the Font menu or type a back quote ( ` ). The back quote toggles between Normal and Greek fonts.
Following standard mathematical convention, all letters in the name beyond the first one are displayed as a subscript when the constant is used in an Expression window.
The value of a named constant can be any valid expression such as 3 or -1+0.5*i. You can even include other named constants. This allows you to reuse a value in several other constants and to store functions of x for plotting.
The "New constant" item on the Actions menu creates a new constant with the initial value of zero.
The "Remove constant" item on the Actions menu removes the selected constant, if it is not being used in any expressions or plots. (Note that even if a constant is not visible in any Expression windows, it may still be used in an undo buffer. If you quit and restart, all undo buffers will be cleared.)
You can change the name and value of a constant even when it is in use. All expressions will automatically be redrawn to display the new name, and all plots will be redrawn to use the new value. Among other uses, this can help you visualize how a function changes as its parameters vary.
The Base Conversion window lets you convert between base 2, 8, 10, and 16. Simply enter the starting value in the text field corresponding to the original base and the values in all the other bases will be displayed automatically. You can copy the text in any text field with the keyboard shortcut Meta-C.
The Expression window also accepts hexadecimal values prefixed by 0x
, so you can convert from hex to decimal by simply typing the number and pressing return.